On Sun, May 3, 2009 at 1:03 AM, Zach Welch <z...@superlucidity.net> wrote:
> On Sun, 2009-05-03 at 00:40 +0200, Michael Schwingen wrote:
>> Zach Welch wrote:
>> > If the header is required, the configure step should fail when it is not
>> > found in the system.  The rule is to fail as early as possible.
>> >
>> > Which headers?
>> >
>> Not system headers - I was thinking about in-project headers (either
>> user-edited, config.h or similar) that define some kind of
>> INCLUDE_FEATURE_XXX switch. When multiple source files depend on that
>> switch, forgetting to include it in one of them can get "interesting"
>> results when using #ifdef.
>
> These type of features can be handled by --enable-feature-xxx options.
>
> The autoconf 2.63 info pages are great documentation.  Section 4.9.1
> explains the config.h header fairly well, while Section 6.2.1 explains
> the differences between #if and #ifdef:
>
> """
>   Both `#if HAVE_STDBOOL_H' and `#ifdef HAVE_STDBOOL_H' will work with
> any standard C compiler.  Some developers prefer `#if' because it is
> easier to read, while others prefer `#ifdef' because it avoids
> diagnostics with picky compilers like GCC with the `-Wundef' option.
> """
>
> As you can imagine, I favor #ifdef for this reason.

I can't see your point. The idea of -Wundef is to warn you if you
forgot to include a configuration file that defines variables that you
use in your source code. And you say you favor #ifdef over #if because
with #ifdef you will not be warned about your mistake ?!


Michael
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to