This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/81871] New: bogus attribute alloc_align accepted
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 16 Aug 2017 19:31:24 +0000
- Subject: [Bug c/81871] New: bogus attribute alloc_align accepted
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81871
Bug ID: 81871
Summary: bogus attribute alloc_align accepted
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
Similar to bug 78666, GCC accepts nonsensical attribute alloc_align specifiers
on functions where they have no meaning, such as on on functions that return
void or those that reference arguments of non-integer types. They should
either be diagnosed with -Wattributes or rejected with an error.
$ cat a.c && gcc -O2 -S -Wall -Wextra -Wpedantic -Werror a.c
void __attribute__ ((alloc_align (1))) f (void*);