Open cnettel opened 3 years ago
This supposedly fixes issue #45.
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.
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.