[ Return to Bugs & Features | Post Text | Post File | Prev | Next ]
|Status:||5 - New|
|Priority:||1 - Request for Enhancement, e.g. asking for a feature|
|Scope:||3 - Applies to all machines and operating systems|
|Summary:||Consistent configuration macros|
Trouble Report Files:
[ Post File ]
Trouble Report Comments:
[ Post Text ]
02:00 Feb 28, 2016
|[This bug should be filed against 1.4-feature, but that is not yet an option in the new-bug form.] |
This was previously discussed in
(see comments #9 and #20).
Currently, configuration cpp macros defined in the generated config.h header take either of two forms:
* Define to 0 or 1 (e.g. HAVE_GL)
* Leave undefined, or define to 1 (e.g. USE_X11)
This is confusing and error-prone. For example. the first kind of macro is normally checked using #if, and the second is checked using #ifdef or "#if defined()". If you get mixed up and check the first kind of macro with #ifdef, then the conditional is always enabled, regardless of the value. If you check the second kind of macro using #if, you get -Wundef warnings from GCC when the macro is undefined.
Autoconf has standardized on the second kind of macro, and I believe we should too. I propose that all macros of the first kind be converted to the second kind, so that all config macros are undef-or-1, and will gladly provide a patch if this is acceptable.
13:52 Feb 28, 2016
|Thanks for posting this, moved to 1.4-feature, priority 1 (RFE). ||
[ Return to Bugs & Features | Post Text | Post File ]