diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2023-05-11 11:04:30 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-15 07:00:29 +0200 |
commit | fc003cd2481e654154a02f5772ecac19ed102294 (patch) | |
tree | 98f438090c4b106a83677073467a7b40396cc01a /Userland/Libraries/LibC | |
parent | 2123fdd6783a756751d72bba394d106ac15c842e (diff) | |
download | serenity-fc003cd2481e654154a02f5772ecac19ed102294.zip |
Userland: Silence or resolve new GCC 13 warnings
GCC 13 produces the following true positive warnings:
- `-Wredundant-move` when trying to move `result->tooltip()`, which
is a const reference in `Assistant/main.cpp`
- `-Wuse-after-free` when freeing an environment variable before
removing it from `s_malloced_environment_variables`
- `-Wdangling-pointer` when storing an AST node's `this` pointer to the
interpreter's node stack in LibJS. This is not actually an issue, as
it is popped when the scope ends, but GCC has no way of telling this.
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r-- | Userland/Libraries/LibC/stdlib.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibC/stdlib.cpp b/Userland/Libraries/LibC/stdlib.cpp index 687de3a7a3..8e006129e0 100644 --- a/Userland/Libraries/LibC/stdlib.cpp +++ b/Userland/Libraries/LibC/stdlib.cpp @@ -399,8 +399,8 @@ static void free_environment_variable_if_needed(char const* var) { if (!s_malloced_environment_variables.contains((FlatPtr)var)) return; - free(const_cast<char*>(var)); s_malloced_environment_variables.remove((FlatPtr)var); + free(const_cast<char*>(var)); } char* getenv(char const* name) |