-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Description
Gcc supports warning flag -Walloc-size: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Warn about calls to allocation functions decorated with attribute alloc_size that specify insufficient size for the target type of the pointer the result is assigned to, including those to the built-in forms of the functions aligned_alloc, alloca, calloc, malloc, and realloc.
Clang doesn't support this flag or catch the same issues gcc can catch with the flag. See: https://godbolt.org/z/roMdhxce4
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer