diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-10-06 14:02:33 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-10-06 14:02:33 (GMT) |
commit | 74c066c2c7de70c95f190cb956365a1853796b40 (patch) | |
tree | 9f1330544317bca56239147e1ce6be869a6a33ae /bin/genparser | |
parent | 4c6f59d273508ae88453970dfdc12797307b7108 (diff) | |
download | hdf5-74c066c2c7de70c95f190cb956365a1853796b40.zip hdf5-74c066c2c7de70c95f190cb956365a1853796b40.tar.gz hdf5-74c066c2c7de70c95f190cb956365a1853796b40.tar.bz2 |
Refactor parser GCC diagnostic statements
Diffstat (limited to 'bin/genparser')
-rwxr-xr-x | bin/genparser | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/bin/genparser b/bin/genparser index e6aee5b..8728dea 100755 --- a/bin/genparser +++ b/bin/genparser @@ -1,10 +1,10 @@ #! /bin/bash # -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in # the COPYING file, which can be found at the root of the source code # distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. # If you do not have access to either file, you may request a copy from @@ -204,8 +204,8 @@ ${HDF5_FLEX} --nounistd -PH5LTyy -o ${path_to_hl_src}/H5LTanalyze.c ${path_to_hl # instead of int. Currently the generated function H5LTyyparse is # generated with a return value of type int, which is a mapping to the # flex yyparse function. The return value in the HL library should be -# an hid_t. -# I propose to not use flex to generate this function, but for now I am +# an hid_t. +# I propose to not use flex to generate this function, but for now I am # adding a perl command to find and replace this function declaration in # H5LTparse.c. perl -0777 -pi -e 's/int yyparse/hid_t yyparse/igs' ${path_to_hl_src}/H5LTparse.c @@ -218,7 +218,8 @@ perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' ${path_to_hl_src}/H5 # will simply ignore them, but we want to avoid those warnings. for f in ${path_to_hl_src}/H5LTparse.c ${path_to_hl_src}/H5LTanalyze.c do - echo '#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ ' >> tmp.out + echo '#if defined (__GNUC__) ' >> tmp.out + echo '#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 ' >> 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 @@ -230,11 +231,16 @@ do echo '#pragma GCC diagnostic ignored "-Wsign-conversion" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wstrict-overflow" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wstrict-prototypes" ' >> tmp.out + echo '#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" ' >> 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 '#endif ' >> tmp.out + echo '#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 600 ' >> tmp.out + echo '#pragma GCC diagnostic ignored "-Wnull-dereference" ' >> tmp.out + echo '#endif ' >> tmp.out echo '#elif defined __SUNPRO_CC ' >> tmp.out echo '#pragma disable_warn ' >> tmp.out echo '#elif defined _MSC_VER ' >> tmp.out |