This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Warning annoyances in list_read.c
- From: Dominique d'Humières <dominiq at lps dot ens dot fr>
- To: "jvdelisle at charter dot net" <jvdelisle at charter dot net>
- Cc: markus at trippelsdorf dot de, Steve Kargl <sgk at troutmask dot apl dot washington dot edu>, GCC-Fortran-ML <fortran at gcc dot gnu dot org>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 27 Mar 2017 12:18:17 +0200
- Subject: Re: Warning annoyances in list_read.c
- Authentication-results: sourceware.org; auth=none
> > 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