On Sat, Jun 04, 2016 at 06:33:57PM +0200, Sebastian Benoit wrote:
> Add format attributes to the proper functions and then fix the warning in
> session.c.
>
> ok?
OK claudio
Make sure that bgpctl still compiles in all its version (bgplg)
> diff --git bgpd.h bgpd.h
> index 5fa046e..eaf93e6 100644
> --- bgpd.h
> +++ bgpd.h
> @@ -989,15 +989,24 @@ struct in6_addr *prefixlen2mask6(u_int8_t prefixlen);
> /* log.c */
> void log_init(int);
> void log_verbose(int);
> -void logit(int, const char *, ...);
> -void vlog(int, const char *, va_list);
> -void log_peer_warn(const struct peer_config *, const char *, ...);
> -void log_peer_warnx(const struct peer_config *, const char *, ...);
> -void log_warn(const char *, ...);
> -void log_warnx(const char *, ...);
> -void log_info(const char *, ...);
> -void log_debug(const char *, ...);
> -void fatal(const char *, ...) __dead;
> +void logit(int, const char *, ...)
> + __attribute__((__format__ (printf, 2, 3)));
> +void vlog(int, const char *, va_list)
> + __attribute__((__format__ (printf, 2, 0)));
> +void log_peer_warn(const struct peer_config *, const char *, ...)
> + __attribute__((__format__ (printf, 2, 3)));
> +void log_peer_warnx(const struct peer_config *, const char *, ...)
> + __attribute__((__format__ (printf, 2, 3)));
> +void log_warn(const char *, ...)
> + __attribute__((__format__ (printf, 1, 2)));
> +void log_warnx(const char *, ...)
> + __attribute__((__format__ (printf, 1, 2)));
> +void log_info(const char *, ...)
> + __attribute__((__format__ (printf, 1, 2)));
> +void log_debug(const char *, ...)
> + __attribute__((__format__ (printf, 1, 2)));
> +void fatal(const char *, ...) __dead
> + __attribute__((__format__ (printf, 1, 2)));
> void fatalx(const char *) __dead;
>
> /* mrt.c */
> diff --git session.c session.c
> index 8c853a1..e736b76 100644
> --- session.c
> +++ session.c
> @@ -2017,7 +2017,7 @@ parse_open(struct peer *peer)
>
> /* check bgpid for validity - just disallow 0 */
> if (ntohl(bgpid) == 0) {
> - log_peer_warnx(&peer->conf, "peer BGPID %lu unacceptable",
> + log_peer_warnx(&peer->conf, "peer BGPID %u unacceptable",
> ntohl(bgpid));
> session_notification(peer, ERR_OPEN, ERR_OPEN_BGPID,
> NULL, 0);
>
>
--
:wq Claudio