diff --git a/client/birdcl.c b/client/birdcl.c index 7b567a9f..4508185c 100644 --- a/client/birdcl.c +++ b/client/birdcl.c @@ -125,7 +125,7 @@ more_end(void) } static void -sig_handler(int signal) +sig_handler(int signal UNUSED) { cleanup(); exit(0); diff --git a/client/util.c b/client/util.c index 2d6c074d..1d83e518 100644 --- a/client/util.c +++ b/client/util.c @@ -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, " ... "); fputs(buf, stderr); fputc('\n', stderr); diff --git a/conf/Makefile b/conf/Makefile index c1a906e3..e5828538 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -24,6 +24,7 @@ $(o)cf-lex.c: $(s)cf-lex.l $(FLEX) $(FLEX_DEBUG) -s -B -8 -Pcf_ -o$@ $< $(o)cf-lex.o: $(o)cf-parse.tab.h $(o)keywords.h +$(o)cf-lex.o: CFLAGS+=-Wno-sign-compare -Wno-unused-function $(addprefix $(o), cf-parse.y keywords.h commands.h cf-parse.tab.h cf-parse.tab.c cf-lex.c): $(objdir)/.dir-stamp diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 9eb4f116..ad9aa10a 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -577,7 +577,7 @@ cf_lex_init(int is_cli, struct config *c) cf_lex_init_kh(); ifs_head = ifs = push_ifs(NULL); - if (!is_cli) + if (!is_cli) { ifs->file_name = c->file_name; ifs->fd = c->file_fd; diff --git a/conf/conf.c b/conf/conf.c index 175e223b..b6f41b2c 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -85,7 +85,7 @@ int undo_available; /* Undo was not requested from last reconfiguration */ * further use. Returns a pointer to the structure. */ struct config * -config_alloc(byte *name) +config_alloc(const byte *name) { pool *p = rp_new(&root_pool, "Config"); linpool *l = lp_new(p, 4080); @@ -405,7 +405,7 @@ config_confirm(void) * if it's been queued due to another reconfiguration being in progress now, * %CONF_UNQUEUED if a scheduled reconfiguration is removed, %CONF_NOTHING * if there is no relevant configuration to undo (the previous config request - * was config_undo() too) or %CONF_SHUTDOWN if BIRD is in shutdown mode and + * was config_undo() too) or %CONF_SHUTDOWN if BIRD is in shutdown mode and * no new configuration changes are accepted. */ int @@ -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(); @@ -530,7 +530,7 @@ cf_error(const char *msg, ...) * and we want to preserve it for further use. */ char * -cfg_strdup(char *c) +cfg_strdup(const char *c) { int l = strlen(c) + 1; char *z = cfg_allocu(l); diff --git a/conf/conf.h b/conf/conf.h index 03fecd32..593a5f13 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -20,7 +20,7 @@ struct config { linpool *mem; /* Linear pool containing configuration data */ list protos; /* Configured protocol instances (struct proto_config) */ list tables; /* Configured routing tables (struct rtable_config) */ - list logfiles; /* Configured log fils (sysdep) */ + list logfiles; /* Configured log files (sysdep) */ int mrtdump_file; /* Configured MRTDump file (sysdep, fd in unix) */ char *syslog_name; /* Name used for syslog (NULL -> no syslog) */ @@ -60,7 +60,7 @@ struct config { extern struct config *config; /* Currently active configuration */ extern struct config *new_config; /* Configuration being parsed */ -struct config *config_alloc(byte *name); +struct config *config_alloc(const byte *name); int config_parse(struct config *); int cli_parse(struct config *); void config_free(struct config *); @@ -94,7 +94,7 @@ extern linpool *cfg_mem; #define cfg_alloc(size) lp_alloc(cfg_mem, size) #define cfg_allocu(size) lp_allocu(cfg_mem, size) #define cfg_allocz(size) lp_allocz(cfg_mem, size) -char *cfg_strdup(char *c); +char *cfg_strdup(const char *c); void cfg_copy_list(list *dest, list *src, unsigned node_size); /* Lexer */ diff --git a/conf/confbase.Y b/conf/confbase.Y index 22edbdfd..094c81b5 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -143,7 +143,7 @@ expr_us: /* Switches */ bool: - expr {$$ = !!$1; } + expr { $$ = !!$1; } | ON { $$ = 1; } | YES { $$ = 1; } | OFF { $$ = 0; } @@ -202,7 +202,7 @@ net_roa4_: net_ip4_ MAX NUM AS NUM { $$ = cfg_alloc(sizeof(net_addr_roa4)); net_fill_roa4($$, net4_prefix(&$1), net4_pxlen(&$1), $3, $5); - if ($3 < net4_pxlen(&$1) || $3 > IP4_MAX_PREFIX_LENGTH) + if ($3 < (int) net4_pxlen(&$1) || $3 > IP4_MAX_PREFIX_LENGTH) cf_error("Invalid max prefix length %d", $3); }; @@ -210,7 +210,7 @@ net_roa6_: net_ip6_ MAX NUM AS NUM { $$ = cfg_alloc(sizeof(net_addr_roa6)); net_fill_roa6($$, net6_prefix(&$1), net6_pxlen(&$1), $3, $5); - if ($3 < net6_pxlen(&$1) || $3 > IP6_MAX_PREFIX_LENGTH) + if ($3 < (int) net6_pxlen(&$1) || $3 > IP6_MAX_PREFIX_LENGTH) cf_error("Invalid max prefix length %d", $3); }; diff --git a/configure.in b/configure.in index a0db0fbd..58f865c4 100644 --- a/configure.in +++ b/configure.in @@ -88,11 +88,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 diff --git a/doc/Makefile b/doc/Makefile index 3ff73389..4e7e91eb 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -25,6 +25,9 @@ $(o)%.sgml: $(s)%.sgml $(objdir)/.dir-stamp $(o)%.html: $(o)%.sgml cd $(dir $@) && $(sgml2)html $(notdir $<) +$(o)%.tex: $(o)%.sgml + cd $(dir $@) && $(sgml2)latex --output=tex $(notdir $<) + $(o)%.dvi: $(o)%.tex cd $(dir $@) && TEXINPUTS=$(TEXINPUTS):$(doc-srcdir)/tex latex $(notdir $<) cd $(dir $@) && TEXINPUTS=$(TEXINPUTS):$(doc-srcdir)/tex latex $(notdir $<) @@ -32,11 +35,9 @@ $(o)%.dvi: $(o)%.tex $(o)%.ps: $(o)%.dvi dvips -D600 -ta4 -o $@ $< -$(o)%.pdf: $(o)%.ps - ps2pdf $< $@ - -$(o)%.tex: $(o)%.sgml - cd $(dir $@) && $(sgml2)latex --output=tex $(notdir $<) +$(o)%.pdf: $(o)%.tex + pdflatex -output-directory=$(dir $@) $< + pdflatex -output-directory=$(dir $@) $< $(o)%.txt: $(o)%.sgml cd $(dir $@) && $(sgml2)txt $(notdir $<) diff --git a/doc/bird.sgml b/doc/bird.sgml index 26673f03..6af0e0f6 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -39,11 +39,12 @@ This document contains user documentation for the BIRD Internet Routing Daemon p Introduction +