mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* problem with ccflags := -Werror in Makefiles when building with gcc 4.6.0
@ 2011-03-09 16:28 Douglas Mencken
  2011-03-09 17:22 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Douglas Mencken @ 2011-03-09 16:28 UTC (permalink / raw)
  To: linux-kernel

When building with gcc 4.6.0 with the new type of warnings introduced,
-Wunused-but-set-variable, many directories with ccflags set to
-Werror in Makefile fail to build.

Example:
> arch/powerpc/kernel/align.c:704:33: error: variable 'instruction' set but not used [-Werror=unused-but-set-variable]
> cc1: all warnings being treated as errors

I'm currently using the following workaround to get rid of `-Werror':

list_of_makefiles=`find . -name Makefile -print0 | xargs -0 grep -H
"ccflags" | grep "\-Werror" | \
                   sed "s/Makefile:/Makefile@\t/g" | cut -d'@' -f1`
echo "${list_of_makefiles}" | while read the_makefile
do
  sed -i 's/-Werror//g' "${the_makefile}"
done

I wish to be personally CC'ed the answers/comments posted to the list
in response.

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

* Re: problem with ccflags := -Werror in Makefiles when building with gcc 4.6.0
  2011-03-09 16:28 problem with ccflags := -Werror in Makefiles when building with gcc 4.6.0 Douglas Mencken
@ 2011-03-09 17:22 ` Joe Perches
  2011-03-09 18:00   ` Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2011-03-09 17:22 UTC (permalink / raw)
  To: Douglas Mencken
  Cc: linux-kernel, Borislav Petkov, Michal Marek, Sam Ravnborg,
	Ingo Molnar, linux-kbuild

On Wed, 2011-03-09 at 17:28 +0100, Douglas Mencken wrote:
> When building with gcc 4.6.0 with the new type of warnings introduced,
> -Wunused-but-set-variable, many directories with ccflags set to
> -Werror in Makefile fail to build.

After the kbuild W=<level> gets accepted,
it might be reasonable to add another W
level to make warnings fatal and remove
all -Werror entries from the various Makefiles.

See Borislav's patch
https://lkml.org/lkml/2011/3/1/76

and Ingo's idea
https://lkml.org/lkml/2011/3/9/186



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

* Re: problem with ccflags := -Werror in Makefiles when building with gcc 4.6.0
  2011-03-09 17:22 ` Joe Perches
@ 2011-03-09 18:00   ` Sam Ravnborg
  0 siblings, 0 replies; 3+ messages in thread
From: Sam Ravnborg @ 2011-03-09 18:00 UTC (permalink / raw)
  To: Joe Perches
  Cc: Douglas Mencken, linux-kernel, Borislav Petkov, Michal Marek,
	Ingo Molnar, linux-kbuild

On Wed, Mar 09, 2011 at 09:22:50AM -0800, Joe Perches wrote:
> On Wed, 2011-03-09 at 17:28 +0100, Douglas Mencken wrote:
> > When building with gcc 4.6.0 with the new type of warnings introduced,
> > -Wunused-but-set-variable, many directories with ccflags set to
> > -Werror in Makefile fail to build.
> 
> After the kbuild W=<level> gets accepted,
> it might be reasonable to add another W
> level to make warnings fatal and remove
> all -Werror entries from the various Makefiles.

It does not make sense to remove -Werror.
They are there by default.

It is just plain wrong to go removing -Werror that has been there for ages.
Either we fix the warnings or we tell gcc to shut up.

	Sam

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

end of thread, other threads:[~2011-03-09 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-09 16:28 problem with ccflags := -Werror in Makefiles when building with gcc 4.6.0 Douglas Mencken
2011-03-09 17:22 ` Joe Perches
2011-03-09 18:00   ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®