This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/81512] New: duplicate note in -Walloca-larger-than and alloca in a return statement
- 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: Fri, 21 Jul 2017 21:12:23 +0000
- Subject: [Bug middle-end/81512] New: duplicate note in -Walloca-larger-than and alloca in a return statement
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81512
Bug ID: 81512
Summary: duplicate note in -Walloca-larger-than and alloca in a
return statement
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: msebor at gcc dot gnu.org
Target Milestone: ---
When a call to alloca() used as the argument of a return statement like in the
case below triggers a -Walloca-larger-than warning it ends up printing two
identical notes mentioning the size limit when one is expected.
$ cat a.c && gcc -O2 -S -Wall -Walloca-larger-than=12344 a.c
#define alloca __builtin_alloca
void* f (void)
{
return alloca (12345);
}
a.c: In function ‘f’:
a.c:1:16: warning: argument to ‘alloca’ is too large [-Walloca-larger-than=]
#define alloca __builtin_alloca
^
a.c:5:10: note: in expansion of macro ‘alloca’
return alloca (12345);
^~~~~~
a.c:1:16: note: limit is 12344 bytes, but argument is 12345
#define alloca __builtin_alloca
^
a.c:5:10: note: in expansion of macro ‘alloca’
return alloca (12345);
^~~~~~