Commit 3e236955 authored by Jan Moskyto Matejka's avatar Jan Moskyto Matejka Committed by Ondrej Zajicek (work)
Browse files

Build: switch on -Wextra, get rid of most of the warnings

There are several unresolved -Wmissing-field-initializers on older
versions of GCC than 5.1, all of them false positive.
parent 17fe57d8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ more_end(void)
}

static void
sig_handler(int signal)
sig_handler(int signal UNUSED)
{
  cleanup();
  exit(0);
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ vlog(const char *msg, va_list args)
  int n = vsnprintf(buf, sizeof(buf), msg, args);
  if (n < 0)
    snprintf(buf, sizeof(buf), "???");
  if (n >= sizeof(buf))
  else if (n >= (int) sizeof(buf))
    snprintf(buf + sizeof(buf) - 100, 100, " ... <too long>");
  fputs(buf, stderr);
  fputc('\n', stderr);
+2 −0
Original line number Diff line number Diff line
@@ -29,3 +29,5 @@ cf-lex.c: cf-lex.l
	$(FLEX) $(FLEX_DEBUG) -s -B -8 -ocf-lex.c -Pcf_ cf-lex.l

depend: keywords.h commands.h cf-parse.tab.c cf-lex.c

cf-lex.o: CFLAGS+=-Wno-sign-compare -Wno-unused-function
+1 −1
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ config_undo(void)
extern void cmd_reconfig_undo_notify(void);

static void
config_timeout(struct timer *t)
config_timeout(struct timer *t UNUSED)
{
  log(L_INFO "Config timeout expired, starting undo");
  cmd_reconfig_undo_notify();
+3 −1
Original line number Diff line number Diff line
@@ -111,11 +111,13 @@ fi

if test "$bird_cflags_default" = yes ; then
	BIRD_CHECK_GCC_OPTION(bird_cv_c_option_wno_pointer_sign, -Wno-pointer-sign, -Wall)
	BIRD_CHECK_GCC_OPTION(bird_cv_c_option_wno_missing_init, -Wno-missing-field-initializers, -Wall -Wextra)
	BIRD_CHECK_GCC_OPTION(bird_cv_c_option_fno_strict_aliasing, -fno-strict-aliasing)
	BIRD_CHECK_GCC_OPTION(bird_cv_c_option_fno_strict_overflow, -fno-strict-overflow)

	CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wno-parentheses"
	CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes -Wno-parentheses"
	BIRD_ADD_GCC_OPTION(bird_cv_c_option_wno_pointer_sign, -Wno-pointer-sign)
	BIRD_ADD_GCC_OPTION(bird_cv_c_option_wno_missing_init, -Wno-missing-field-initializers)
	BIRD_ADD_GCC_OPTION(bird_cv_c_option_fno_strict_aliasing, -fno-strict-aliasing)
	BIRD_ADD_GCC_OPTION(bird_cv_c_option_fno_strict_overflow, -fno-strict-overflow)
fi
Loading