2020-12-24 Paul Eggert <eggert@cs.ucla.edu>
+ careadlinkat: improve warning line number
+ This propagates an idea first used in canonicalize-lgpl.
+ * lib/careadlinkat.c (GCC_BOGUS_WRETURN_LOCAL_ADDR):
+ New macro.
+ (careadlinkat): Use it.
+
linkat: use eloop-threshold
* lib/linkat.c: Include eloop-threshold.h.
Do not include sys/param.h.
# if defined GCC_LINT || defined lint
__attribute__ ((__noinline__))
# elif __OPTIMIZE__ && !__NO_INLINE__
-# warning "GCC might issue a bogus -Wreturn-local-addr warning here."
-# warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
+# define GCC_BOGUS_WRETURN_LOCAL_ADDR
# endif
#endif
static char *
/* Allocate the initial buffer on the stack. This way, in the
common case of a symlink of small size, we get away with a
single small malloc instead of a big malloc followed by a
- shrinking realloc.
-
- If GCC -Wreturn-local-addr warns about this buffer, the warning
- is bogus; see readlink_stk. */
+ shrinking realloc. */
+ #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
+ #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
+ #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
+ #endif
char stack_buf[STACK_BUF_SIZE];
return readlink_stk (fd, filename, buffer, buffer_size, alloc,
preadlinkat, stack_buf);