folpindo / skipfish

Automatically exported from code.google.com/p/skipfish
Apache License 2.0
0 stars 0 forks source link

Preprocessor use of USE_COLOR (config.h, debug.h) is inconsistent #203

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
config.h has:

     #define USE_COLOR  1       /* Use terminal colors  */

which (in my eyes) implies that changing 1 to 0 would negate this option.

However, debug.h checks it by means of

     #ifdef USE_COLORS

thus, the value of USE_COLOR is irrelevant. This is inconsistent, and may lead 
to confusion, and thus to debug sessions.

Suggestion: Define USE_COLOR without specifying a value.  That makes
the actual configuration option clearer to anyone who wants to get rid of 
colours. 

I'm not sure it's the best way to do configurations in general, though, but it 
seems the smallest change to make things reasonably consistent, as I find no 
#if's in the code, only #ifdef's and #ifndef's.

Original issue reported on code.google.com by a...@algonet.se on 4 Jan 2014 at 12:48