From: Simon Wunderlich <sw@simonwunderlich.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [batctl] compiling with gcc 7.1.0: there are some notes and warnings
Date: Thu, 01 Jun 2017 10:34:39 +0200 [thread overview]
Message-ID: <2479408.89UKcKX64H@prime> (raw)
In-Reply-To: <1496077749.5980.2.camel@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2362 bytes --]
On Monday, May 29, 2017 7:09:09 PM CEST Philipp Psurek wrote:
> Hi all,
>
> it's nothing to worry about but since 2011 I always noticed a clean
> compile run of your code. Now with gcc 7.1.0 there are some warnings
> and notes that might interest you:
>
> ~ LANG=C make
> CC bat-hosts.o
> CC debugfs.o
> CC debug.o
> CC functions.o
> CC genl.o
> CC hash.o
> CC icmp_helper.o
> CC interface.o
> CC ioctl.o
> CC main.o
> CC netlink.o
> CC ping.o
> CC sys.o
> In file included from sys.c:37:0:
> sys.c: In function 'handle_ra_setting':
> sys.h:33:25: warning: '%s' directive output may be truncated writing up to
> 255 bytes into a region of size 185 [-Wformat-truncation=] #define
> SYS_IFACE_PATH "/sys/class/net"
> ^
> sys.h:38:30: note: in expansion of macro 'SYS_IFACE_PATH'
> #define SYS_ROUTING_ALGO_FMT SYS_IFACE_PATH"/%s/mesh/routing_algo"
> ^~~~~~~~~~~~~~
> sys.c:480:38: note: in expansion of macro 'SYS_ROUTING_ALGO_FMT'
> snprintf(path_buff, PATH_BUFF_LEN, SYS_ROUTING_ALGO_FMT,
> iface_dir->d_name); ^~~~~~~~~~~~~~~~~~~~
> sys.h:38:46: note: format string is defined here
> #define SYS_ROUTING_ALGO_FMT SYS_IFACE_PATH"/%s/mesh/routing_algo"
> ^~
> sys.c:480:3: note: 'snprintf' output between 34 and 289 bytes into a
> destination of size 200 snprintf(path_buff, PATH_BUFF_LEN,
> SYS_ROUTING_ALGO_FMT, iface_dir->d_name);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> CC tcpdump.o
> CC tp_meter.o
> tp_meter.c: In function 'tp_meter':
> tp_meter.c:502:3: warning: this statement may fall through
> [-Wimplicit-fallthrough=] printf("CANCEL received: test aborted\n");
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> tp_meter.c:504:2: note: here
> case BATADV_TP_REASON_COMPLETE:
> ^~~~
> CC traceroute.o
> CC translate.o
> LD batctl
>
> # batctl -v
> batctl 2017.1-1-g3069ca8 [batman-adv: 2017.1-4-g2149d80d]
>
> It's really nothing bad at all. gcc 7.1.0 is somehow a little bit
> capricious but with more suggestions to make cleaner code.
>
Hi Philipp,
thanks for showing this. I think none of that is really critical, and the fall
through is actually intended.
Do you want to propose a patch for these things?
Cheers,
Simon
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-06-01 8:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-29 17:09 [B.A.T.M.A.N.] [batctl] compiling with gcc 7.1.0: there are some notes and warnings Philipp Psurek
2017-06-01 8:34 ` Simon Wunderlich [this message]
2017-06-03 2:14 ` Philipp Psurek
2017-06-03 3:12 ` [B.A.T.M.A.N.] [PATCH] batctl: suppress implicit-fallthrough compiler warning Philipp Psurek
2017-06-03 10:13 ` Philipp Psurek
2017-06-03 10:31 ` Philipp Psurek
2017-06-03 3:40 ` [B.A.T.M.A.N.] [PATCH] batctl: change PATH_BUFF_LEN to maximal possible value Philipp Psurek
2017-06-13 8:25 ` [B.A.T.M.A.N.] [batctl] compiling with gcc 7.1.0: there are some notes and warnings Philipp Psurek
2017-06-13 8:25 ` [B.A.T.M.A.N.] [PATCH 1/2] batctl: change PATH_BUFF_LEN to maximal possible value Philipp Psurek
2017-06-13 8:49 ` Simon Wunderlich
2017-06-13 8:26 ` [B.A.T.M.A.N.] [PATCH 2/2] batctl: suppress implicit-fallthrough compiler warning Philipp Psurek
2017-06-13 8:48 ` Simon Wunderlich
2017-06-13 10:39 ` [B.A.T.M.A.N.] [PATCH 2/2] batctl: suppress implicit-fallthrough compiler Philipp Psurek
2017-06-13 10:39 ` [B.A.T.M.A.N.] [PATCH] batctl: suppress implicit-fallthrough compiler warning Philipp Psurek
2017-06-13 11:08 ` [B.A.T.M.A.N.] [PATCH 2/2] " Philipp Psurek
2017-06-13 11:08 ` [B.A.T.M.A.N.] [PATCH] " Philipp Psurek
2017-06-13 11:46 ` Simon Wunderlich
2017-06-13 11:53 ` Sven Eckelmann
2017-06-13 11:55 ` Sven Eckelmann
2017-06-13 12:25 ` Philipp Psurek
2017-06-13 8:42 ` [B.A.T.M.A.N.] [batctl] compiling with gcc 7.1.0: there are some notes and warnings Simon Wunderlich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2479408.89UKcKX64H@prime \
--to=sw@simonwunderlich.de \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox