Skip to content

Commit

Permalink
Configure: Avoid Cppsym warnings for extra tokens [perl #113024]
Browse files Browse the repository at this point in the history
The cppsymbols can include macros such as __INT16_C(c), which can't
be tested with a simple #ifdef.  This patch strips off the opening
parenthesis and everything following it.  These macros were generated
by cpp -dM.

Also ensure Cppsym.true list is sorted for later input to comm.
(I noticed this while testing this change on Solaris.)
  • Loading branch information
doughera88 authored and jkeenan committed Sep 7, 2021
1 parent 5875c53 commit 89d1429
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Configure
Expand Up @@ -21633,15 +21633,16 @@ $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $r
EOSH
chmod +x Cppsym.try
$eunicefix Cppsym.try
./Cppsym < Cppsym.know > Cppsym.true
./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
: Add in any linux cpp "predefined macros":
case "$osname::$gccversion" in
*linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
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
Expand Down

0 comments on commit 89d1429

Please sign in to comment.