c - Debug Macro strange behaviour -
i have file such:
#include <stdio.h> #include <string.h> #include <stdlib.h> #define debug int main(void) { #ifdef debug printf("we in debug mode"); #endif }
i told use ifdef , endif (for this). problem occurs when compile this, using makefile(which i'm not allowed edit). happens print statement (debug one) prints, shouldn't because i'm not in debug mode. tried use command (on ubuntu 14.04)
make -debug
but did different, , output file, prints ifdef statement, despite not being in debug mode. doing wrong?
you explicitly defining debug in source file
#define debug
remove line not overriding definition build environment.
Comments
Post a Comment