A lot of unused parameters
With CFLAGS="-O2 -march=native -Wall -Wextra -fsanitize=undefined -fno-sanitize-recover=all" I get a lot of unused parameters. The first ones arise from fmpz_mod_poly where ctx is often unused, but I'm sure that there are a lot more examples.
These things must have a performance hit (although inlined functions should not be affected by this).
Pros of removing these unused parameters:
- Users does not have to write a lot of extra stuff.
- Performance gain.
- No wall of warnings.
Cons:
- Breaking the interface. However, as FLINT is probably going to bump the major version soon, I think it is reasonable to expect some breaking changes.
- A lot of time needs to be spent fixing this.
If we for some reason do not want to remove such parameters, we should make those parameters have the attribute unused. This makes it clear in the code that we are aware of this problem, and it also does not produce a wall of warnings.
We certainly won't remove the parameters. Can you imagine trying to remember which functions take them and which don't?
And if we ever change the functions in such a way that they are needed, we'd be in real trouble with the interface.
We can add some pragmas I suppose, but it's a lot of extra mess.
Yeah, sounds like pragmas is the way to go.
Some common alternatives are listed here: https://stackoverflow.com/q/3599160/928031
This is handled by #2085.