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 middle-end/81512] New: duplicate note in -Walloca-larger-than and alloca in a return statement


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);
          ^~~~~~

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