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: Marek Polacek <polacek at redhat dot com>
- To: "Dominique d'Humières" <dominiq at lps dot ens dot fr>
- Cc: "jvdelisle at charter dot net" <jvdelisle at charter dot net>, 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 16:53:33 +0200
- Subject: Re: Warning annoyances in list_read.c
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=polacek at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D2A08C04BD22
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D2A08C04BD22
- References: <B0359206-B586-4FF4-AB05-7E0CAB3B9B16@lps.ens.fr>
On Mon, Mar 27, 2017 at 12:18:17PM +0200, Dominique d'Humières wrote:
> > > 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?
Yes, it's known that the "falls through" comments don't work if they're
preceding a macro.
Marek