summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-03-09 09:19:48 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-03-09 09:19:48 (GMT)
commit42eee37a261902ebb2bf65b291512a0dddd6b081 (patch)
treea84916a0a36e02bfacf682144cec6b9ca6ea527a
parentce19753d87babcd578fbc9fb7b9329722e3a604c (diff)
downloadhdf5-42eee37a261902ebb2bf65b291512a0dddd6b081.zip
hdf5-42eee37a261902ebb2bf65b291512a0dddd6b081.tar.gz
hdf5-42eee37a261902ebb2bf65b291512a0dddd6b081.tar.bz2
[svn-r26397] Manually added flex/bison warning disable pragmas from r26351
from the trunk. Fixes: HDFFV-9149 Tested on: jam - examined gcc 4.9.2 output for warnings - ran 'make check' in hl directory
-rwxr-xr-xautogen.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
index 82d6552..5517c61 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -420,6 +420,37 @@ ${HDF5_FLEX} --nounistd -PH5LTyy -o H5LTanalyze.c H5LTanalyze.l
# H5LTparse.c.
perl -0777 -pi -e 's/int\nyyparse/hid_t\nyyparse/igs' H5LTparse.c
perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' H5LTparse.c
+
+# Add code that disables warnings in the flex/bison-generated code.
+#
+# Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions
+# will simply ignore them, but we want to avoid those warnings.
+for f in H5LTparse.c H5LTanalyze.c
+do
+ echo '#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wconversion" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wlarger-than=" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wmissing-prototypes" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wnested-externs" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wold-style-definition" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wsign-compare" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wsign-conversion" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wstrict-prototypes" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wswitch-default" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wunused-function" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wunused-macros" ' >> tmp.out
+ echo '#pragma GCC diagnostic ignored "-Wunused-parameter" ' >> tmp.out
+ echo '#elif defined __SUNPRO_CC ' >> tmp.out
+ echo '#pragma disable_warn ' >> tmp.out
+ echo '#elif defined _MSC_VER ' >> tmp.out
+ echo '#pragma warning(push, 1) ' >> tmp.out
+ echo '#endif ' >> tmp.out
+
+ cat $f >> tmp.out
+ mv tmp.out $f
+done
+
cd ../..
echo