bug-grep
[Top][All Lists]
Advanced

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

Re: [PATCH] mbsstr: fix warnings reported by gcc -Wcast-align on ARM


From: Dmitry V. Levin
Subject: Re: [PATCH] mbsstr: fix warnings reported by gcc -Wcast-align on ARM
Date: Mon, 4 Oct 2010 22:53:18 +0400

On Mon, Oct 04, 2010 at 12:20:19PM -0600, Eric Blake wrote:
> On 10/04/2010 12:15 PM, Dmitry V. Levin wrote:
> >>In summary, please turn off -Werror when compiling gnulib code. We don't
> >>guarantee the absence of warnings.
> >
> >The project where -Werror is enabled by default is GNU grep.  If the
> >statement that gnulib code may emit -Wcast-align warnings is correct, then
> >I suggest to remove either -Wcast-align or $(WERROR_CFLAGS) when compiling
> >gnulib in grep.
> 
> Jim maintains both grep and coreutils.  In coreutils, his solution is to 
> manually disable compiler flags known to be incompatible with gnulib 
> while still using -Werror for the flags that are okay; such that the 
> gnulib portion of coreutils is compiled with fewer warnings than the 
> coreutils portion.  It shouldn't be too hard to use that same paradigm 
> in grep.

The same method is already in use in grep nowadays, so the patch is
straightforward:

From a2b98bac33cb209a5b037351d68d981e9dc78dfc Mon Sep 17 00:00:00 2001
From: Dmitry V. Levin <address@hidden>
Date: Mon, 4 Oct 2010 18:49:14 +0000
Subject: [PATCH] Compile gnulib without -Wcast-align that cause warnings on ARM

* configure.ac (GNULIB_WARN_CFLAGS): Remove -Wcast-align.
---
 configure.ac |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 481ce86..3c28218 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,6 +124,7 @@ if test "$gl_gcc_warnings" = yes; then
   nw="$nw -Wunused-macros"
   #nw="$nw -Wmissing-prototypes"
   nw="$nw -Wold-style-definition"
+  nw="$nw -Wcast-align"
   gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
   AC_SUBST([GNULIB_WARN_CFLAGS])
 fi


-- 
ldv

Attachment: pgpKurQApg7ye.pgp
Description: PGP signature


reply via email to

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