Fix compiler errors and warnings #1
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request fixes the compiler errors and warnings further down that I encountered in my Pseudosquares-Prime-Sieve. I have tested these fixes on the montgomery_pow_kary branch of my Pseudosquares-Prime-Sieve project and all unit tests pass successfully: https://github.com/kimwalisch/Pseudosquares-Prime-Sieve/actions/runs/15957320257
I tested using Clang on macOS, using GCC on Windows with MSYS2/MinGW-w64 and using GCC and Clang on Linux. My code compiles without any compilers warnings now using
-Wall -Wextra -pedantic
.Fixed errors
The errors below have been fixed by using
if constexpr()
from C++17. I have also updated theCMakeLists.txt
and setcxx_std_17
on thehurchalla_modular_arithmetic
interface library so that the compiler uses a C++ standard >= 2017 (when your library is included by some other CMake project). My error fixes require C++17 or later because I currently don't know how to fix these errors without C++17.Fixed warnings
The warnings below have been fixed by using
int
instead ofsize_t
for theP
variable. I could also have castedP
to anint
but since this is basically required for every single usage ofP
it seemed better to simply change P's type to anint
.