Mail Archives: djgpp/1997/03/10/01:38:55
On 9 Mar 1997, Jerzy Witkowski wrote:
> Here is the mentioned clause from file `gmp.h':
>
> #if defined (FILE) || defined (H_STDIO) || defined (_H_STDIO) \
> || defined (_STDIO_H) || defined (_STDIO_H_) || defined (__STDIO_H__) \
> || defined (_STDIO_INCLUDED) || defined (__dj_include_stdio_h_)
> #define _GMP_H_HAVE_FILE 1
> #endif
>
> I just continued the author's idea. :-)
And one bad idea it is, indeed.
If a program needs to know whether FILE datatype is defined, it should use
other methods than relying on symbols defined by headers (to protect
themselves from multiple inclusion). I suspect that what the program
really wants is to see whether <stdio.h> has already been included (by
some other header) to avoid including it for the second time. But since
any decent compiler/library should protect itself, this is unnecessary and
harmful. It is harmful because no standard document defines what that
symbol should be, and a new release of a library can definitely change
that symbol, thereby breaking the program.
- Raw text -