Passing the CLI argument '--list-tags' outputs a list like:
```
All available tags:
11 [mytag]
4 [myothertag]
2 tags
```
However, the width of the tag-count column was previously hardcoded to 2, such that the formatting broke (with the tag names awkwardly misaligned/displaced) for 3+ digit tag counts. This occurred whenever a tag contains one hundred or more tests, and would result in formatting like:
```
All available tags:
11 [mytag]
100 [myjumbotag]
4 [myothertag]
3 tags
```
This patch pre-computes the maximum number of digits among the tag counts, expanding the padding when there are more than 100 tests in a tag (and handling when tags are empty). It now outputs e.g.
```
All available tags:
11 [mytag]
100 [myjumbotag]
4 [myothertag]
3 tags
```
With -fsanitize=integer every over/under-flowing integer manipulation triggers a warning.
This is extremely useful as it allows to find some non-obvious bugs such as
for(size_t i = 0; i < N - 1; i++) { ... }
But it comes with a lot of false positives, for instance with every hash function
doing shifting on unsigned integer. Random number generators are also often detected
with this sanitizer.
This marks a few of these functions as safe in this case.
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
Support for GCC 7 and 8 can continue on an as-needed basis. The
goal is not to explicitly break support for such compilers. Chances
are they will continue to compile Catch2 for some time into the
future. Rather, it no longer seems a prudent use of resources to
continuously test with these compilers.
The old `Start-FileDownload` was no longer recognized by the pswh
version on my local machine, this updates the OpenCppCoverage install
script to use a still usable cmdlet.
We still want to build VS 2017 through AppVeyor, and those images
have CMake 3.16.2 installed. We could install newer CMake as part
of the build, but since we don't use newer CMake features yet, this
is simpler.
`gmtime*` on Windows fails on dates pre 1970, and because we didn't
check the return code, we would then pass invalid `tm` struct to
`strftime` causing it to assert.
Closes#2944
Turns out that even in GCC, the expression in `__builtin_cosntant_p`
can end up evaluated and side-effects executed. To allow users to
work around this bug, I added a configuration option to disable its
use in internal macros.
Related to #2925