problem with ccflags := -Werror in Makefiles when building with gcc 4.6.0
From: Douglas Mencken
Date: Wed Mar 09 2011 - 11:29:03 EST
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/