Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict compiler warning policy for CI builds #1203

Merged
merged 6 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ jobs:
config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI, BaseOMP]
include:
- config_set: BaseMPI
flags: '-Denable-pywrapper=true -Denable-tests=true --werror'
flags: '-Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
- config_set: ReverseMPI
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --werror'
flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
- config_set: ForwardMPI
flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true --werror'
flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true --warnlevel=3 --werror'
- config_set: BaseNoMPI
flags: '-Denable-pywrapper=true -Dwith-mpi=disabled -Denable-tests=true --werror'
flags: '-Denable-pywrapper=true -Dwith-mpi=disabled -Denable-tests=true --warnlevel=3 --werror'
- config_set: ReverseNoMPI
flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --werror'
flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror'
- config_set: ForwardNoMPI
flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-tests=true --werror'
flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-tests=true --warnlevel=3 --werror'
- config_set: BaseOMP
flags: '-Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --werror'
flags: '-Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3 --werror'
runs-on: ubuntu-latest
steps:
- name: Cache Object Files
Expand Down
2 changes: 0 additions & 2 deletions UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ TEST_CASE("NTS blending has a minimum of 0.05", "[Upwind/central blending]") {

/*--- Setup ---*/

const unsigned short nDim = 3;

CConfig* config = new CConfig(config_options, SU2_CFD, false);

const su2double dissipation_i = 0;
Expand Down
1 change: 0 additions & 1 deletion UnitTests/test_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ int main(int argc, char *argv[]) {
#else
SU2_MPI::Init(&argc, &argv);
#endif
SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm();

/*--- Run the test driver supplied by Catch ---*/
int result = Catch::Session().run(argc, argv);
Expand Down
7 changes: 6 additions & 1 deletion externals/cgns/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
if build_machine.system() == 'windows' or meson.get_compiler('cpp').get_id() == 'intel'
cgns_default_warnings = []
else
cgns_default_warnings = ['-Wno-unused-result']
cgns_default_warnings = ['-Wno-unused-result',
'-Wno-unused-parameter',
'-Wno-unused-variable',
'-Wno-unused-but-set-variable',
'-Wno-sign-compare',
'-Wno-pedantic']
endif

cgns_include = include_directories('adf', './')
Expand Down
13 changes: 12 additions & 1 deletion externals/metis/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@ metis_default_warnings = []
if build_machine.system() != 'windows'
metis_default_warnings += ['-Wno-implicit-function-declaration']
if meson.get_compiler('cpp').get_id() != 'intel'
metis_default_warnings += ['-Wno-unused-result', '-Wno-macro-redefined']
metis_default_warnings += ['-Wno-unused-result',
'-Wno-unused-parameter',
'-Wno-unused-variable',
'-Wno-unused-but-set-variable',
'-Wno-macro-redefined',
'-Wno-unknown-pragmas',
'-Wno-sign-compare',
'-Wno-clobbered',
'-Wno-empty-body',
'-Wno-unused-label',
'-Wno-misleading-indentation',
'-Wno-pedantic']
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe compiler warnings had not been invented when metis was written

endif
endif

Expand Down
2 changes: 1 addition & 1 deletion externals/parmetis/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ parmetis = static_library('parmetis',
'libparmetis/match.c',
'libparmetis/mmetis.c',
install : false, include_directories: parmetis_include,
dependencies: [mpi_dep, metis_dep], c_args: parmetis_c_args)
dependencies: [mpi_dep, metis_dep], c_args: parmetis_c_args + metis_default_warnings)

parmetis_dep = declare_dependency(link_with: parmetis, include_directories: parmetis_include)
9 changes: 9 additions & 0 deletions externals/tecio/teciompisrc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ if (host_machine.system() == 'windows')
tec_cxx_flags += ['-DMSWIN']
endif

if build_machine.system() != 'windows'
if meson.get_compiler('cpp').get_id() != 'intel'
tec_cxx_flags += ['-Wno-misleading-indentation',
'-Wno-uninitialized',
'-Wno-placement-new',
'-Wno-pedantic']
endif
endif


teciompi_include = include_directories(['../', './'])

Expand Down
9 changes: 9 additions & 0 deletions externals/tecio/teciosrc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ if (host_machine.system() == 'windows')
tecio_cpp_flags += ['-DMSWIN']
endif

if build_machine.system() != 'windows'
if meson.get_compiler('cpp').get_id() != 'intel'
tecio_cpp_flags += ['-Wno-misleading-indentation',
'-Wno-uninitialized',
'-Wno-placement-new',
'-Wno-pedantic']
endif
endif

tecio_include = include_directories('../', './')
tecio = static_library('tecio',
'ClassicZoneWriterAbstract.cpp',
Expand Down
10 changes: 6 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ if build_machine.system() != 'windows'
default_warning_flags += ['-Wno-empty-body']
endif
default_warning_flags += ['-Wno-unused-parameter',
'-Wno-format-security',
'-Wno-deprecated-declarations',
'-Wno-non-virtual-dtor']
'-Wno-deprecated-declarations']

if get_option('enable-autodiff') or get_option('enable-directdiff')
default_warning_flags += ['-Wno-non-virtual-dtor']
endif
endif

# meson script path
Expand Down Expand Up @@ -236,4 +238,4 @@ if get_option('enable-mpp')
export LD_LIBRARY_PATH=$SU2_HOME/<build_dir>/subprojects/Mutationpp

''')
endif
endif