Avoid Cppsym warnings for extra tokens [perl #113024]
authorAndy Dougherty <doughera@lafayete.edu>
Wed, 6 Jun 2012 13:35:31 +0000 (09:35 -0400)
committerAndy Dougherty <doughera@lafayete.edu>
Wed, 6 Jun 2012 13:35:31 +0000 (09:35 -0400)
The cppsymbols can include macros such as __INT16_C(c), which can't
best tested with a simple #ifdef.  This patch strips off the opening
parenthesis and everything following it.  These macros were generated
by cpp -dM.

U/modified/Cppsym.U

index 6eed09b..12f9ffe 100644 (file)
@@ -223,8 +223,9 @@ case "$osname::$gccversion" in
     tHdrH=_tmpHdr
     rm -f $tHdrH'.h' $tHdrH
     touch $tHdrH'.h'
+    # Filter out macro arguments, such as Linux's __INT8_C(c)
     if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
-       sed 's/#define[\ \  ]*//;s/[\ \     ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
+       sed -e 's/#define[\ \  ]*//;s/[\ \     ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
        if [ -s $tHdrH'_cppsym.real' ]; then
          cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
        fi