Commit Graph

48 Commits

Author SHA1 Message Date
Oliver Stöneberg dcdf67a694
some `-Wdouble-promotion` Clang compiler warnings (#4820) 2023-08-07 20:44:25 +02:00
Rainer Wiesenfarth f4f58bf020
Fix #11081 GUI: Windows release build crashes (#5083)
* Fix #11081 GUI: Windows release build crashes

Use generator expressions rather than if statements when adding compiler
options or definitions.

* Fix #11081 GUI: Windows CMake debug build fails with default options

When DISABLE_CRTDBG_MAP_ALLOC is using the default value (OFF), the
debug build of cppcheck-gui fails, as the "realloc" method names in some
of the Qt headers are replaced by the macro defined by the compiler.
Thus DISABLE_CRTDBG_MAP_ALLOC is explicitely set when compiling
cppcheck-gui in Debug mode using MSVC.
2023-06-07 11:33:55 +02:00
Oliver Stöneberg cb915085ea
use C++17 when building with Visual Studio in CMake - fixes GUI CI builds (#4924)
* use C++17 when building with Visual Studio in CMake

* printInfo.cmake: print more variables

* CMakeLists.txt: set C++ standard earlier
2023-03-31 10:37:53 +02:00
Oliver Stöneberg 7ce82e4fcb
enabled and fixed remaining `-Wdeprecated-copy-dtor` Clang compiler warnings (#4860) 2023-03-07 12:28:00 +01:00
Oliver Stöneberg a250e6b569
enabled and mitigated `-Wunreachable-code` Clang warnings (#4818) 2023-02-24 21:57:44 +01:00
Oliver Stöneberg f0ebaf9536
compileroptions.cmake: fixed workaround for Clang >= 14 (#4737) 2023-02-16 16:42:08 +01:00
Oliver Stöneberg 367847cf57
updated CI to Clang 16 (#4641) 2023-02-15 19:46:13 +01:00
Oliver Stöneberg 8bb5ac0efd
improved `MathLib::to{ULong|Long|Double}Number()` and increased test coverage / added CMake option `USE_LIBCXX` / fixed #10695 (#4611) 2022-12-07 09:20:09 +01:00
Oliver Stöneberg 3dfdb409c6
fixed and enabled some Clang compiler warnings (#4517) 2022-09-29 21:59:02 +02:00
Paul Fultz II a586b9e8ee
Use safe compile option (#4413) 2022-08-27 23:22:31 +02:00
Oliver Stöneberg 32c0167eab
specify `-pipe` for GCC to use pipes instead of temporary files - greatly reduces I/O usage (#4360) 2022-08-16 22:12:01 +02:00
Oliver Stöneberg d6eb3a8f40
some changes for clang/clang-tidy 15 (#4310) 2022-07-26 15:30:53 +02:00
Oliver Stöneberg e8b0f12367
replaced `if(MATCHES)` with `if(STREQUAL)` (#4263)
`MATCHES` does regular expression matching which is not the intended behavior here. `Clang` still requires it since it also needs to match `AppleClang.
2022-07-11 10:46:18 +02:00
Armin Müller 0ae9877766
Typos found by running "codespell" (#4260) 2022-07-10 22:40:05 +02:00
Oliver Stöneberg d299d22fa2
updated CI to latest ubuntu and clang (#4004) 2022-05-22 15:27:32 +02:00
Oliver Stöneberg fdca61add9
aligned build options of Visual Studio project configurations and added them to CMake (#4020) 2022-04-21 21:28:29 +02:00
Paul Fultz II 32ded1602b
Fix warnings in switch statements on clang (#3943) 2022-03-30 19:30:02 +02:00
Oliver Stöneberg 0d336b868c
avoid some Clang compiler warnings (#3896) 2022-03-13 20:07:58 +01:00
Oliver Stöneberg a15a227b73
bumped minimum supported GCC version to 4.8 (#3768) 2022-02-05 17:57:32 +01:00
Paul Fultz II 1f5c3670bd
Use a unique variable name when checking if a flag is valid (#3532) 2021-10-30 09:07:06 +02:00
Oliver Stöneberg cc1a18806c
use -Weverything for clang in CMake / fixed some warnings (#3519) 2021-10-24 11:06:48 +02:00
Paul Fultz II 59a1c1a9d8
Refactor: Remove variable analyzer (#3339) 2021-07-18 07:46:31 +02:00
chrchr-github 8cd8b9c64e
Fix MSVC build and some warnings (#3334) 2021-07-16 21:55:12 +02:00
Oliver Stöneberg dcc90c6dfa
improved compiler warnings about missing attributes (#3232) 2021-04-25 12:52:09 +02:00
Oliver Stöneberg 491f4874c5
fixed/aligned some compiler warnings (#3065) 2021-01-21 18:13:32 +01:00
Oliver Stöneberg 0a1012a273
fixed and enabled -Wdocumentation and -Wdocumentation-pedantic clang warnings (#2819) 2020-12-27 09:15:59 +01:00
Oliver Stöneberg fa8a836925
fixed some clang warnings (#2980) 2020-12-26 13:46:28 +01:00
Oliver Stöneberg 1077b0d2a6
small compileroptions.cmake cleanup (#2817)
* compileroptions.cmake: moved common warnings to proper scope and aligned them with other build systems / fixed some -Wrange-loop-construct clang warnings

* compileroptions.cmake: use check_cxx_compiler_flag() via add_compile_options_safe() helper to avoid compiler version checks
2020-09-21 19:41:28 +02:00
Daniel Marjamäki 3ebd97c448 cmake: disable -Wno-maybe-uninitialized. There can be false positives and therefore this is not working well together with -Werror option. 2020-08-21 17:17:49 +02:00
Oliver Stöneberg 3a90341961
some CMake cleanups and additions (#2639) 2020-05-27 05:15:46 +02:00
Oliver Stöneberg c1f762b861
disabled some Visual Studio warnings (#2635) 2020-05-23 17:42:56 +02:00
Oliver Stöneberg 1388e9385b
cleaned up setting of compiler options and a few more things in CMake (#2599)
* cleaned up compiler options related code in CMake

* moved cmake_minimum_required() and raised to latest 2.8.x version

* use proper compiler version check / print compiler version

* fixed linking of sanitized builds

* added proper version checks to newer Clang warnings and enabled them / moved tinyxml_objs flags to proper compiler

* disabled -Wdeprecated-declarations for Clang

* compileroptions.cmake: removed unnecessary check for clang++ existence - CMAKE_CXX_COMPILER_ID is determined by CMake

* printInfo.cmake: removed unnecessary message for ANALYZE_ADDRESS - LSAN is part of ASAN and enabled by default

* cleaned up if() comparisons in CMake

* added/adjusted TODOs
2020-04-22 11:04:19 +02:00
Oliver Stöneberg 1af959af2c
fixed -Wextra-semi-stmt Clang warnings (#2553)
* fixed -Wextra-semi-stmt Clang warnings

* adjusted REDIRECT macro to require a semicolon

* testmathlib.cpp: rolled back accidental change
2020-04-21 17:27:51 +02:00
Oliver Stöneberg e3b644d877
aligned GCC warnings (#2592)
* excluded oss-fuzz related CMake targets from all

* checkstl.cpp: fixed -Wmissing-declarations warning

* suppress -Wsuggest-attribute=format GCC warnings for tinyxml in CMake for now

* aligned GCC warnings in dmake, CMake and Travis / removed now useless WARNINGS_ANSI_ISO
2020-04-08 14:56:12 +02:00
Oliver Stöneberg 8bc4e38213
Disable warnings causing too much noise (#2578)
Co-authored-by: Joachim Reichel <reichel@debian.org>
2020-03-31 08:33:17 +02:00
Sebastian 6e74d6810a
cmake/compileroptions.cmake: Fix missing stack options under Cygwin (#2560)
testrunner fails with SEGFAULT when built with cmake under Cygwin.
This fix adds a compiler option to increase the stack size in the same
way as it is already done in the Makefile.
2020-03-03 18:37:49 +01:00
IOBYTE c2ccfd5f8b Increase Windows stack size to 8M (#1998)
* Increase Windows stack size to 8M

* try to add stack size cmake
2019-07-15 12:39:58 +02:00
Daniel Marjamäki 44ba9b5caf cmake: turn off Wconversion and Wsign-promo warnings 2019-07-08 08:09:51 +02:00
Scott Furry fc61596c40 Adjustments to CMake Building (#1925)
From CMake Docs( https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html ),
BUILD_SHARED_LIBS may not be defined. This can result in printinfo.cmake outputing
variable without a value. A conditional is applied to ensure that some output is
provided to the user should variable not be defined.

Removed explicit C++ standard flag. Any setting user would add on the command
line would be replaced due to ordering. `-std=c++0x` would be last value added
to CMAKE_CXX_FLAGS and ultimately the one used by the compiler.
2019-06-26 07:41:48 +02:00
Carlo Marcelo Arenas Belón bf5c71bdca sync (#1835)
* build: remove -Wabi and add -Wundef

gcc >= 8 throws a warning about -Wabi (without a specific ABI version)
being ignored, while -Wundef seems more useful (as shown by the change
in config.h, which was probably an unfortunate typo)

travis.yaml should probably be updated soon, but was left out from this
change as the current images don't yet need it

* lib: unused function in valueflow

refactored out since 8c03be3212

lib/valueflow.cpp:3124:21: warning: unused function 'endTemplateArgument' [-Wunused-function]

* readme: include picojson

* make: also clean exe
2019-05-17 09:31:41 +02:00
Daniel Marjamäki 1048aa8ead Disable Wshadow warnings
[ci skip]
2018-11-23 22:34:21 +01:00
Paul Fultz II e839001f3d Fix warnings (#1478) 2018-11-14 06:14:04 +01:00
Oliver Stöneberg 373039f034 Minor Cleanups (#1321)
* added CLion project folder to .gitignore

* adjusted project name in CMakeLists.txt

* avoid warning when compiling "Debug" with Visual Studio via CMake

There was a GCC-style compiler flag in the common flags in compileroptions.cmake which caused the following warning:
cl : Command line warning D9002 : ignoring unknown option '-O0'

* compileroptions.cmake: restored original formatting
2018-07-23 08:34:41 +02:00
Ayaz Salikhov 64e61d28ba Add an ability to use address sanitizer (#979) 2017-10-21 21:04:14 +02:00
Frank Zingsheim 2b2a1e7ab2 Fixed #7749 (CMake gcc version >= 4.6 see https://github.com/danmar/cppcheck#compiling) 2016-10-29 12:55:50 +02:00
Frank Zingsheim e5a3ba7cac Switch off -D_GLIBCXX_DEBUG for Clang on Linux
(see 73b088a6dd for Makefile)
2015-11-26 21:13:04 +01:00
Frank Zingsheim 70c20515a9 Cmake object linkage. Fix #7128: (cppcheck 1.70 doesn't report any warnings) 2015-11-26 20:25:09 +01:00
Luis Díaz Más 22424ba54a Add CMake files 2015-02-13 19:00:14 +01:00