-
Notifications
You must be signed in to change notification settings - Fork 290
Open
Labels
Description
Is your feature request related to a problem? Please describe.
Currently, COEFF_TO_PTR is supposed to take in a fmpz = slong instead of a fmpz_t = fmpz[1], but if you accidentally pass a fmpz_t into it, it will still compile, but does the wrong thing (usually segmentation fault) later.
COEFF_IS_MPZ has a similar issue, but at least it will compile error instead of segmentation fault.
In addition to the segmentation fault, this leads to code of the form
fmpz c = *f;
if (!COEFF_IS_MPZ(c)) /* f is small */
Describe the solution you'd like
I suggest doing one of the following
- Use
_Genericmacro (requires C11 or later) to make it accept bothfmpzandfmpz_t. - make them a
FLINT_FORCE_INLINEfunction to allow type checking.
Reactions are currently unavailable