Skip to content

clang unknown warning option '-Walloc-size' #138973

@jstengleingithub

Description

@jstengleingithub

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

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions