Re: Preprocessor Directives



Daniel Rudy said:


Hello Group,

Is there a preprocessor directive that will cause the compiler to
print
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
.



Relevant Pages

  • Re: [PATCH] a new UniCore32 arch-dependent patch for linux-2.6.37-rc1
    ... I've started a review of your code with lots of comments for roughly ... multi-cpu support from the ARM tree. ... * compiler that it's constant. ...
    (Linux-Kernel)
  • Re: how do you start learning assembly language
    ... compiler technology for decades, and which every compiler author have ... And I have refuted your claim that monofiles are bad idea or "design lack" ... Yes, I said that if an assembler did not support linking, it ...
    (alt.lang.asm)
  • ANN: Chicken 2.0
    ... - The compiler is able to inline more procedure calls ... - The alternative continuation API described in Marc Feeley's paper ... Hash-tables support now user-defined hash functions ...
    (comp.lang.scheme)
  • Re: Lint
    ... There are many versions of lint out there from "free" to expensive. ... Free, as in open source, will often take time to get full use of - and it may have hidden "costs" (such as license or support issues). ... Secondly, C compilers do much better static error checking than they used to as a side effect of better optimisation - while figuring out things like aliasing, variable lifetimes, and ideal memory organisation, a compiler can often spot buffer overflows and other such errors. ...
    (comp.arch.embedded)
  • Re: made it to page 4 of gforth tutorial
    ... you the facts over and over and your coming back saying it was ... So let's review again. ... 2DROP as if an optimizing compiler was going to turn the ... it would have professional support. ...
    (comp.lang.forth)