odelaneau / shapeit4

Segmented HAPlotype Estimation and Imputation Tool
MIT License
90 stars 18 forks source link

Change return type of merge #48

Open cnettel opened 3 years ago

cnettel commented 3 years ago

Avoid spurious warnings and more importantly, aggressive compiler optimizations leading to crashes. gcc 9.3 and 10.2 both crashed at odd locations when high optimization levels were enabled and the return type was bool with no return statement. In general, compiler optimizatons are allowed to assume that "undefined behavior" does not occur, but I could not swear on a simple return statement missing going into that category.

cnettel commented 3 years ago

This supposedly fixes issue #45.

leecbaker commented 3 years ago

Adding a warning like -Wreturn-type or perhaps even an error with -Werror=return-type to the build scripts would prevent this type of programming error from happening again in the future.