aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-03-24 23:06:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-03-24 23:06:58 -0700
commit6fc3b2c676022bc95eaf275e1c9d58bffedfbdad (patch)
treed0fbb374375c9cd13600cd3b500042a5f1edf7a4
parent7ff3eec770fec644870762c31f433c497ee93f05 (diff)
downloadcppawk-6fc3b2c676022bc95eaf275e1c9d58bffedfbdad.tar.gz
cppawk-6fc3b2c676022bc95eaf275e1c9d58bffedfbdad.tar.bz2
cppawk-6fc3b2c676022bc95eaf275e1c9d58bffedfbdad.zip
Pass -std=c99 to cpp to remove crap like #define linux.
-rwxr-xr-xcppawk3
-rw-r--r--testcases7
2 files changed, 8 insertions, 2 deletions
diff --git a/cppawk b/cppawk
index bf9ad2d..d6b29d4 100755
--- a/cppawk
+++ b/cppawk
@@ -31,8 +31,9 @@
prepro=cpp
incopt=-iquote # GNU extension: must be changed to -I for traditional cpp
dumpopt=-dM # GNU cpp option to dump macros
+stdopt=-std=c99 # GNU cpp option for standard conformance
awk=gawk
-prepro_opts="-D__gawk__=1 -D__cppawk_ver=20220324"
+prepro_opts="-D__gawk__=1 -D__cppawk_ver=20220324 $stdopt"
# globals
bash=${BASH_VERSION+y}
diff --git a/testcases b/testcases
index 6e256ce..06a399c 100644
--- a/testcases
+++ b/testcases
@@ -187,7 +187,7 @@ yes
33:
$cppawk --prepro-only --prepro=./testdir/testcpp abc
:
-[-iq][-D_][-D_][-I.][-]
+[-iq][-D_][-D_][-st][-I.][-]
--
34:
$cppawk --prepro-only --awk=mawk mawk=__mawk__ | grep mawk
@@ -245,3 +245,8 @@ testdir/name.cwk
$cppawk --dump-macros '#define foo_bar 42' | grep foo_bar
:
#define foo_bar 42
+--
+43:
+$cppawk --dump-macros x | (grep -q '#define [A-Za-z]' || echo "clean")
+:
+clean