Skip to content

Fix -Wreturn-type errors in fNNRandom

In case global CFLAGS contains -Werror=return-type, compilation fails as shown below. For some reason gcc is unable to recognize the possible range of values in the switch statements, which can only ever be between zero and seven.

Assist the compiler by adding a default statement. This fixes compilation in openSUSE Tumbleweed, which adds -Werror=return-type to global CFLAGS.

source/genCases_f64.c: In function 'f64Random': source/genCases_f64.c:559:1: error: control reaches end of non-void function [-Werror=return-type]

source/genCases_f32.c: In function 'f32Random': source/genCases_f32.c:417:1: error: control reaches end of non-void function [-Werror=return-type]

source/genCases_f16.c: In function 'f16Random': source/genCases_f16.c:336:1: error: control reaches end of non-void function [-Werror=return-type]

Signed-off-by: Olaf Hering olaf@aepfle.de

Merge request reports