bug-grep
[Top][All Lists]
Advanced

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

Re: avoid gcc 4.6.2 'may be used before set' warnings in dfa.c


From: Jim Meyering
Subject: Re: avoid gcc 4.6.2 'may be used before set' warnings in dfa.c
Date: Sun, 26 Feb 2012 15:31:48 +0100

Paul Eggert wrote:
> How about going with this patch to address this issue in grep's
> source code?  It uses C11's <stdnoreturn.h>, falling back on a
> simple gnulib substitute for pre-C11 compilers.
> If Awk doesn't use gnulib, Awk can use the stdnoreturn.h
> file that this patch builds, which I can email if you like.

Nice change.
As you've guessed, gawk does not use gnulib.
While this makes dfa.[ch] depend on stdnoreturn.h, all Arnold would
have to do is add a stand-alone stdnoreturn.h to gawk's sources.
You're welcome to push it, now.

I've just pushed an update of gnulib, bootstrap and init.sh
(confirmed with that, tests still pass locally and on Solaris 10)
so your patch should work fine as-is.

>>From fdfa5e9132ca3c57814d752349f4a9a7eeacf573 Mon Sep 17 00:00:00 2001
> From: Paul Eggert <address@hidden>
> Date: Fri, 24 Feb 2012 17:25:50 -0800
> Subject: [PATCH] maint: use stdnoreturn.h rather than rolling our own
>
> * bootstrap.conf (gnulib_modules): Add stdnoreturn.
> * src/grep.h (__attribute__): Remove.
> * src/dfa.h (__attribute__): Likewise.
> Include <stdnoreturn.h>.
> (dfaerror): Use noreturn rather than __attribute__ ((noreturn)).
> * src/dfa.h, src/system.h: Include <stdnoreturn.h>.
> * src/main.c (usage): Likewise.
> ---
>  bootstrap.conf |    1 +
>  src/dfa.h      |    6 ++----
>  src/grep.h     |    4 ----
>  src/main.c     |    3 +--
>  src/system.h   |    1 +



reply via email to

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