unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* GCC 7 warnings
@ 2017-09-09 16:16 Eli Zaretskii
  2017-09-09 18:27 ` Paul Eggert
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2017-09-09 16:16 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Richard Copley, emacs-devel

In http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00151.html,
Richard Copley sent a build log using GCC 7, which reveals several
warnings I think are unrelated to MS-Windows.

First, there are several warnings about fallthrough.  Example:

    CC       tparam.o
  tparam.c: In function 'tparam1':
  tparam.c:126:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
	  if (tem < 100)
	     ^
  tparam.c:128:6: note: here
	case '3':  /* %3 means output in decimal, 3 digits.  */
	^~~~

It turns out we use the -Wimplicit-fallthrough=5 GCC option, which
rejects any previously supported fall-through comments, and instead
insists on using __attribute__((fallthrough)), which triggers warnings
in older versions of GCC.

Paul, why do we use level 5 here, instead of using level 3, the
default?  Level 3 supports the /* FALLTHROUGH */ and similar comments
that indicate a fall-through in a more portable way.  We already have
such comments in many places.

I also see warnings in image.c:

    CC       image.o
  In file included from image.c:33:0:
  image.c: In function 'xbm_scan':
  ../lib/c-ctype.h:185:3: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized]
     switch (c)
     ^~~~~~
  image.c:2577:17: note: 'c' was declared here
     unsigned char c;
		   ^
  image.c: In function 'gif_load':
  image.c:7902:24: warning: 'bgcolor' may be used uninitialized in this function [-Wmaybe-uninitialized]
	  pixel_colors[i] = STRINGP (specified_bg)

(There were a few more warnings which I fixed.)

Thanks.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-09 20:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-09 16:16 GCC 7 warnings Eli Zaretskii
2017-09-09 18:27 ` Paul Eggert
2017-09-09 19:29   ` Eli Zaretskii
2017-09-09 20:30     ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).