JohnCremona / eclib

The eclib package includes mwrank (for 2-descent on elliptic curves over Q) and modular symbol code used to create the elliptic curve database.
GNU General Public License v2.0
21 stars 15 forks source link

Missing default in a switch makes compiler itchy #61

Closed SnarkBoojum closed 4 years ago

SnarkBoojum commented 4 years ago

While having a look at the compilation of eclib (trying to know why I have problems on armel and armhf), I noticed a warning fly by: in libsrc/interface.cc, the longify function is seen by the compiler as not calling return.

Inspection shows there are several implementations ; they have in common a switch on a value without default clause : a potential silent problem arising if it started to have a new possible value.

I'll provide a patch soon.

SnarkBoojum commented 4 years ago

clearer_longify.txt

JohnCremona commented 4 years ago

Thanks for this. In fact one of the last commits I made was to keep lgtm happy with this function, but you are right that there are some missing defaults. But your patch adds 3 defaults, whereas I see only two places where a new one is needed (for the switches on lines 342 and 354) as the switch on line 313 already has a default.

If you agree I'll add the two missing defaults.

JohnCremona commented 4 years ago

@SnarkBoojum Can we close this now? Or do you need a new release? The other changes since the 20190909 release are only minor tweaks to the config system and changing some default parameters in end programs probably only used by me.

SnarkBoojum commented 4 years ago

Yes, no need for a new release. Thanks!