Codebase list openrc / 6282c9d
src/rc/rc-logger.h: fix build failure against gcc-10 On gcc-10 (and gcc-9 -fno-common) build fails as: ``` cc -L../librc -L../libeinfo -O2 -g -std=c99 -Wall -Wextra -Wimplicit -Wshadow \ -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn \ -Wmissing-format-attribute -Wnested-externs -Winline -Wwrite-strings \ -Wcast-align -Wcast-qual -Wpointer-arith -Wdeclaration-after-statement \ -Wsequence-point -Werror=implicit-function-declaration \ -Wl,-rpath=/lib -o openrc rc.o rc-logger.o rc-misc.o rc-plugin.o _usage.o -lutil -lrc -leinfo -Wl,-Bdynamic -ldl ld: rc-logger.o:/home/slyfox/dev/git/openrc/src/rc/rc-logger.h:16: multiple definition of `rc_logger_pid'; rc.o:openrc/src/rc/rc-logger.h:16: first defined here ld: rc-logger.o:/home/slyfox/dev/git/openrc/src/rc/rc-logger.h:17: multiple definition of `rc_logger_tty'; rc.o:openrc/src/rc/rc-logger.h:17: first defined here ``` gcc-10 will change the default from -fcommon to fno-common: https://gcc.gnu.org/PR85678. The error also happens if CFLAGS=-fno-common passed explicitly. This fixes #348. Sergei Trofimovich authored 4 years ago Adam Borowski committed 3 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1212 #ifndef RC_LOGGER_H
1313 #define RC_LOGGER_H
1414
15 pid_t rc_logger_pid;
16 int rc_logger_tty;
15 extern pid_t rc_logger_pid;
16 extern int rc_logger_tty;
1717 extern bool rc_in_logger;
1818
1919 void rc_logger_open(const char *runlevel);