> This may not work.
>...
> Some of those compilers
> would NOT let you '#ifdef' out the version that it did not recognize
> (perhaps thinking that '#warn' or '#warning' might be some gross typo
> for '#else' or '#endif', I guess...).
this is true; some compilers seem to require that #ifdef'd out code be syntactically
correct.
while #warning is not available in ISO C, #error is.
it was deliberate to omit #warning; there is nothing in the standard to require #error
to be fatal.
one could easily argue that #warning would have been useful, even if the distinction
between #warning and #error is hazy.
i don't think pragmas offer a solution, in either the "#pragma warning" or "_Pragma"
forms.
i do not think gcc supports a "warning" pragma however (as in #pragma GCC warning
foobar
or _Pragma("GCC warning foobar")), nor is their such a thing in the STDC pragma
namespace.
one sure way to make things work is to move compiler-specific things to
compiler-specific headers,
which would probably be a good idea anyhow. something like including a
"compiler_specific.h"
which would in turn contain stuff like:
#ifdef __GNUC__
#include "gnu_cruft.h"
#elif __TenDRA__ /* don't know if this is what it is called */
#include "tendra_cruft.h"
#else
#error what compiler is this?
#endif
-mda
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message