Warning message when building tst-pthread-getattr.c

Steve Ellcey sellcey@marvell.com
Thu Jul 25 22:02:00 GMT 2019


I just built the latest glibc with the latest gcc and, when running the
testsuite, got an error.  Has anyone else seen this?  It doesn't look like
the test has changed recently so I am guessing that GCC just got stricter
in its checking.  Should we add a DIAG_IGNORE_NEEDS_COMMENT here?

Steve Ellcey
sellcey@marvell.com


tst-pthread-getattr.c: In function ‘allocate_and_test’:
tst-pthread-getattr.c:54:10: error: function returns address of local variable [-Werror=return-local-addr]
   54 |   return mem;
      |          ^~~
In file included from ../include/alloca.h:3,
                 from tst-pthread-getattr.c:26:
../stdlib/alloca.h:35:23: note: declared here
   35 | # define alloca(size) __builtin_alloca (size)
      |                       ^~~~~~~~~~~~~~~~~~~~~~~
tst-pthread-getattr.c:51:9: note: in expansion of macro ‘alloca’
   51 |   mem = alloca ((size_t) (mem - target));
      |         ^~~~~~
cc1: all warnings being treated as errors
../o-iterator.mk:9: recipe for target '/extra/sellcey/gcc-vect-newalloc/obj-glibc/nptl/tst-pthread-getattr.o' failed


More information about the Libc-alpha mailing list