[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GCC 7 warnings

From: Eli Zaretskii
Subject: GCC 7 warnings
Date: Sat, 09 Sep 2017 19:16:25 +0300

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 
          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.)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]