[systemd-commits] m4/attributes.m4

Lennart Poettering lennart at kemper.freedesktop.org
Fri Sep 14 10:06:59 PDT 2012


 m4/attributes.m4 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cdefbd6aebc43c89aa1eafacd2edc10b605dfee7
Author: Lucas De Marchi <lucas.demarchi at profusion.mobi>
Date:   Fri Sep 14 14:18:41 2012 +0000

    build-sys: Append -Werror when testing flags
    
    Clang don't treat unknown warnings flags as an error, but rather as a
    warning. The result is that the detection for whic CFLAGS are supported
    by this compiler will not work, since the compilation will succeed.
    
    With this patch we now successfully detect clang doesn't support
    -Wlogical-op, as opposed to previous behavior:
    
    	checking if clang supports flag -Wlogical-op in envvar CFLAGS... no
    
    We use this macro only for LDFLAGS and CFLAGS, so it's safe to stash
    -Werror there.

diff --git a/m4/attributes.m4 b/m4/attributes.m4
index e354375..f0bcf24 100644
--- a/m4/attributes.m4
+++ b/m4/attributes.m4
@@ -41,7 +41,7 @@ AC_DEFUN([CC_CHECK_FLAG_APPEND], [
   AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],
                  AS_TR_SH([cc_cv_$2_$3]),
 		 [eval "AS_TR_SH([cc_save_$2])='${$2}'"
-		  eval "AS_TR_SH([$2])='$3'"
+		  eval "AS_TR_SH([$2])='-Werror $3'"
 		  AC_COMPILE_IFELSE([AC_LANG_SOURCE([int a = 0; int main(void) { return a; } ])],
                                     [eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
                                     [eval "AS_TR_SH([cc_cv_$2_$3])='no'"])



More information about the systemd-commits mailing list