Isaac Connor
cd36bd9bf5
Merge pull request #3266 from Carbenium/fill-out-of-bounds
...
Image: Remove std::vector out-of-bounds access when filling polygons
2021-05-30 10:55:22 -04:00
Peter Keresztes Schmidt
c8f2a813e3
Build: Enable VLA warnings
...
VLAs (variable-length arrays) are a C99 feature and were never standardised for C++.
There are better alternatives in C++ (mainly std::vector). Enable the warnings
so no new ones can be introduced.
2021-05-17 22:12:04 +02:00
Peter Keresztes Schmidt
bf08502b9c
Build: Add CMake option to enable Werror
...
With -DENABLE_WERROR the -Werror flag will be passed to the compiler failing the build if a warning is emitted.
2021-05-01 00:07:12 +02:00
Isaac Connor
03b8a98bae
xenial has cmake 3.5.1. VERSION_LESS_EQUAL was introduced in 3.7. So lets use VERSION_LESS,11 instead
2021-04-19 17:06:54 -04:00
Peter Keresztes Schmidt
0676f71cd6
Build/GCC: Suppress -Wclobbered warnings on older compilers
...
There were a high number of false positives with old compilers. Suppress these warnings on them.
2021-04-12 08:58:57 +02:00
Peter Keresztes Schmidt
b93d5556b2
Build: Re-enable Wtype-limits on GCC
2021-04-12 00:25:04 +02:00
Peter Keresztes Schmidt
e8565b0704
Build: Enable implicit fallthrough warnings on clang
2021-04-11 23:39:35 +02:00
Peter Keresztes Schmidt
0ab6b04fa1
build: Enable Woverloaded-virtual on GCC
2021-04-11 01:28:23 +02:00
Andrew Bauer
663c7f51f5
don't set -Wconditionally-supported on older gcc
2021-04-07 10:01:46 -05:00
Peter Keresztes Schmidt
d1bbfdaf6b
Build: Enable -Wconditionally-supported on GCC
...
We want to have warnings if we use some implementation-specific features of GCC
to be able to keep compatibility with clang.
2021-03-18 20:02:23 +01:00
Peter Keresztes Schmidt
0796a2262e
Utils: Replace stringtf with a type-safe version that can't overflow
2021-03-06 00:12:18 +01:00
Peter Keresztes Schmidt
6e2f8bfedb
build: Enable Wextra with some exceptions
...
-Wno-cast-function-type:
Signal handler code relies on this.
-Wno-type-limits:
Some of the color space conversion code in zm_image throws this warning. To not break anything let's ignore this warning for the time being.
Note that clang enables -Woverloaded-virtual with -Wextra. To not flood the GCC build log with warnings let's not enable this at the moment.
This will be done in a second step, when the currently throwing code will be cleaned up.
2021-02-27 02:08:14 +01:00
Peter Keresztes Schmidt
4c07bf5aae
Build: Add ThreadSanitizer (TSan) support
...
Enable it by setting -DTSAN=1
This setting is mutually exclusive with -DASAN
2021-02-11 00:38:31 +01:00
Peter Keresztes Schmidt
424e6e14f6
Build: Add -DASAN option to build with AddressSanitizer support
...
Use this option only for debugging purposes.
2021-02-08 23:13:31 +01:00
Peter Keresztes Schmidt
825ca07561
Build: Use zm-* interfaces to set cxx standard and warning flags
2021-02-08 23:08:22 +01:00
Peter Keresztes Schmidt
407ea70991
Build: Add support for compiler detection
...
Using this system we can separate settings for different compilers nicely.
2021-02-08 23:08:22 +01:00