Problem with _FORTIFY_SOURCE with GCC 9.2.1 on Fedora 31
I am having some issues compiling on my desktop machine after the system was upgraded to Fedora 31.
When configuring with ./configure --disable-optimization --enable-debug
(which leads to -g -O0 -gdwarf -fvar-tracking-assignments -pthread -Wall -Wextra -Wno-unused-parameter -Wshadow -Werror -Wstrict-prototypes
) I get the following error message:
In file included from /usr/include/bits/libc-header-start.h:33,
from /usr/include/limits.h:26,
from /usr/lib/gcc/x86_64-redhat-linux/9/include/limits.h:194,
from /usr/lib/gcc/x86_64-redhat-linux/9/include/syslimits.h:7,
from /usr/lib/gcc/x86_64-redhat-linux/9/include/limits.h:34,
from space.c:29:
/usr/include/features.h:382:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
382 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
| ^~~~~~~
I can get around that by forcing -O
in the CFLAGS but that essentially means we are not fully disabling optimization any more.