dentearl/mafTools

mafComparator has a unused variable / compilation fails

Closed this issue · 1 comments

NB: I checked previous issues, I see similar ones but this is different.

On line 327 of mafTools/mafComparator/src/mafComparator.c, you declare a variable size_t i which is set but never used according to gcc (well, it is used in switch statements only). It is always used as an auxiliary variable - i=sscanf() ..... assert(i==1).

mafTools/inc/common.mk has a gcc flag for BSD which allows it to ignore this issue (-Wno-unused-but-set-variable), which avoids a compilation failure due to the -Werror flag. It should also be included for Linux systems.

Threw -Wno-unused-but-set-variable into the catchall else condition.