Re: Preprocessor Directives
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Wed, 18 Jul 2007 08:04:43 +0000
Daniel Rudy said:
Hello Group,
Is there a preprocessor directive that will cause the compiler to
a warning diagnostic of whatever message that I choose?
Your best bet, and it is not a good bet, is a #pragma, if your compiler
happens to support one that does what you want. (Some do, certainly.)
This, of course, renders your code non-portable.
I'm thinking
of something along the lines of:
#ifndef uint64
#warning 64-bit mode not supported.
#endif
-or-
#ifndef uint64
#error 64-bit support is required.
#endif
The latter is well-defined by ISO C, but has the (unfortunate, in your
case) side-effect of terminating the compilation. If that's acceptable
to you, then that's your answer. Otherwise, you may be forced to go for
a #pragma.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- References:
- Preprocessor Directives
- From: Daniel Rudy
- Preprocessor Directives
- Prev by Date: Re: How to make malloc() fail ?
- Next by Date: Re: Preprocessor Directives
- Previous by thread: Preprocessor Directives
- Next by thread: Re: Preprocessor Directives
- Index(es):
Relevant Pages
|