This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/80378] Extend alloc_size attribute for better Linux kernel checking


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80378

--- Comment #7 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
This sounds like a separate problem that is solvable via __builtin_constant_p? 
For example:

    void link_error(void) __attribute__((error("size check failed")));

    if (__builtin_constant_p(size) && size-0ul >= MAX_ALLOC_SIZE)
      link_error();

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]