Closed adamnovak closed 10 years ago
That's weird, sum
is used two lines away on line 195:
https://github.com/dentearl/mafTools/blob/master/mafExtractor/src/mafExtractorAPI.c#L195
bool *targetColumns = NULL;
uint64_t len = 0, sum = 0;
mafBlock_t *head = NULL, *mb = NULL;
sum = getTargetColumns(&targetColumns, &len, b, seq, start, stop);
// printTargetColumns(targetColumns, len);
int64_t **offsets = createOffsets(maf_mafBlock_getNumberOfSequences(b));
Is there any chance that your line 195 has been changed?
The specific warning is -Wunused-but-set-variable, which is only turned on with -Wall starting in new versions of gcc. So a variable that is set as a return value but never actually used after that still generates an error with those versions.
I didn't actually look very closely, but if this is only used in an assert somewhere, it may still not count as being used if NDEBUG is set. I think Benedict adds a "(void) unused_var;" statement in those cases when they come up.
Hello,
same error with gcc 4.8.2 on Centos 6 and 4.8.1 on Mint 16 (see below). I also have CLANG 3.2-7 but could not figure out acceptable changes to inc/common.mk.
Many thanks for your help,
Darek
src/mafExtractorAPI.c: In function ‘checkBlock’: src/mafExtractorAPI.c:423:17: error: variable ‘dummy’ set but not used [-Werror=unused-but-set-variable] mafBlock_t dummy = NULL; ^ cc1: all warnings being treated as errors make[1]: ** [src/mafExtractorAPI.o] Error 1 make[1]: Leaving directory `/nfs/users/myhome/MAFtools/mafTools/mafExtractor' make: *\ [mafExtractor.all] Error 2
Fails to build on GCC 4.9.0, producing this error: