public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Warning annoyances in list_read.c
@ 2017-03-27 10:18 Dominique d'Humières
  2017-03-27 14:53 ` Marek Polacek
  0 siblings, 1 reply; 26+ messages in thread
From: Dominique d'Humières @ 2017-03-27 10:18 UTC (permalink / raw)
  To: jvdelisle; +Cc: markus, Steve Kargl, GCC-Fortran-ML, GCC Development

> > If he added a new option affecting libgfortran, then he should
> > fix up libgfortran.
>
> He didn't add the warning to specifically annoy fortran developers.
> It is trivial to add seven gcc_fallthrough() or breaks for someone who
> knows the code and the person who added the warning obviously doesn't.
The following patch fixes the warnings

--- ../_clean/libgfortran/io/list_read.c	2017-03-25 20:42:40.000000000 +0100
+++ libgfortran/io/list_read.c	2017-03-27 12:06:10.000000000 +0200
@@ -51,7 +51,8 @@ typedef unsigned char uchar;
 #define CASE_DIGITS   case '0': case '1': case '2': case '3': case '4': \
                       case '5': case '6': case '7': case '8': case '9'
 
-#define CASE_SEPARATORS case ' ': case ',': case '/': case '\n': \
+#define CASE_SEPARATORS /* Fall through. */ \
+	case ' ': case ',': case '/': case '\n': \
 	case '\t': case '\r': case ';'
 
 /* This macro assumes that we're operating on a variable.  */

Indeed before applying this patch, someone will have to check that the warnings do not occur because of missing breaks.

Note that putting /* Fall through. */ before the use of the macro CASE_SEPARATORS does not work. Is it a (known) bug?

Dominique

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

end of thread, other threads:[~2017-03-27 18:55 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <eb8fcb55-8ad5-dbf3-8a2e-91911bc3c752@charter.net>
     [not found] ` <20170326184534.GA18723@troutmask.apl.washington.edu>
2017-03-27  1:45   ` Warning annoyances in list_read.c Jerry DeLisle
2017-03-27  2:31     ` Steve Kargl
2017-03-27  6:58       ` Markus Trippelsdorf
2017-03-27 13:26         ` Steve Kargl
2017-03-27 13:36           ` Jonathan Wakely
2017-03-27 13:50             ` Steve Kargl
2017-03-27 15:06               ` Jonathan Wakely
2017-03-27 15:10               ` Jonathan Wakely
2017-03-27 15:22               ` Markus Trippelsdorf
2017-03-27 16:27                 ` Steve Kargl
2017-03-27 16:45                   ` Marek Polacek
2017-03-27 17:26                     ` Steve Kargl
2017-03-27 17:33                     ` Toon Moene
2017-03-27 17:41                       ` Marek Polacek
2017-03-27 17:59                         ` Thomas Koenig
2017-03-27 18:21                           ` Richard Biener
2017-03-27 18:21                           ` Jonathan Wakely
2017-03-27 18:22                           ` Marek Polacek
2017-03-27 18:16                         ` Steve Kargl
2017-03-27 18:29                           ` Marek Polacek
2017-03-27 18:55                             ` Toon Moene
2017-03-27 13:39           ` Markus Trippelsdorf
2017-03-27 14:44             ` Steve Kargl
2017-03-27 15:04               ` Markus Trippelsdorf
2017-03-27 10:18 Dominique d'Humières
2017-03-27 14:53 ` Marek Polacek

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