fplll / g6k

The General Sieve Kernel
GNU General Public License v2.0
99 stars 30 forks source link

Provisional fix on the initialisation of the VLA. #90

Closed joerowell closed 3 years ago

joerowell commented 3 years ago

This PR is meant to fix issue #89. In particular, the PR replaces the explicit initialisation with a memset.

This is necessary because: a) Stack-allocated arrays are not standard C++. Instead, these are provided by the compiler. b) Older versions of GCC (i.e 4.7 and prior) don't support initialisation via =. Clang -- although not explicitly supported by G6K -- doesn't allow this at all. This can be circumvented with a memset.

Note that this should not degrade performance in any manner. Indeed, the link in the comment shows that GCC calls memset on the variably allocated array anyway: this is just more explicit.