Skip to contentSkip to conversation

Cleanup GCC_WARN_OLDSTYLE content

PATCH New Nicolas Joly 2 participants 2 messages Oct 4, 2015 – Oct 5, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Cleanup GCC_WARN_OLDSTYLE content

Hi,

Checking some build logs, i noticed that some flags "-g -O2" are present multiple times.

cc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W -g -O2 -Wold-style-definition -I/home/njoly/emul/linux/ltp64/testcases/kernel/include -I../../../../include -I../../../../include -L../../../../lib access01.c -lltp -o access01

The third copy on the previous command line comes from GCC_WARN_OLDSTYLE variable which does include CFLAGS, duplicating them and adding the needed -Wold-style-definition warning option.

Attached a small patch to clean this part by only adding the needed option to GCC_WARN_OLDSTYLE.

Thanks.

Signature · 15 lines
Nicolas Joly

Cluster & Computing Group
Biology IT Center
Institut Pasteur, Paris.
-------------- next part --------------
commit bf5a215a6d0ec3774b56c08f56c397753b10997f
Author: Nicolas Joly <[email protected]>
Date:   Sat Mar 21 09:24:49 2015 +0100

    m4: ltp-warn_oldstyle: Cleanup GCC_WARN_OLDSTYLE content.
    
    Do not save whole CFLAGS to GCC_WARN_OLDSTYLE, only the needed option.
    
    Signed-off-by: Nicolas Joly <[email protected]>
m4/ltp-warn_oldstyle.m4 +4 -3
index a35adcc..717e0a3 100644
@@ -19,14 +19,15 @@ dnl
 
 AC_DEFUN([LTP_CHECK_CC_WARN_OLDSTYLE],[dnl
 
-AC_MSG_CHECKING([if $CC supports -Wold-style-definition])
+wflag="-Wold-style-definition"
+AC_MSG_CHECKING([if $CC supports $wflag])
 
 backup_cflags="$CFLAGS"
-CFLAGS+=" -Wold-style-definition"
+CFLAGS+=" $wflag"
 
 AC_LINK_IFELSE(
 	[AC_LANG_PROGRAM([])],
-	[GCC_WARN_OLDSTYLE="$CFLAGS"]
+	[GCC_WARN_OLDSTYLE="$wflag"]
 	[AC_MSG_RESULT([yes])],
 	[AC_MSG_RESULT([no])]
 )