This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Computed Values in Preprocessor
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: aetherane <aetherane at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 29 Sep 2005 13:08:07 -0700
- Subject: Re: Computed Values in Preprocessor
- References: <996023.post@talk.nabble.com>
You mistakenly believe that gcc@gcc.gnu.org is a forum for beginner
questions, but this appears to be nabble.com's fault.
On Thu, Sep 29, 2005 at 12:30:44PM -0700, aetherane (sent by Nabble.com) wrote:
> I have a constant defined, lets call it A:
> #define A 1
> I want to have another constant defined called be such that B=A+2 so you could do:
> #define B A+2
>
> The issue is that I need B to be computed as the value of A+2, not as "A+2" which will be directly plugged into code where ever B is referenced. Is there any way to define a token as the combined value of numbers?
No. C doesn't et you do that.
> Sent from the gcc - General forum at Nabble.com:
> http://www.nabble.com/Computed-Values-in-Preprocessor-t359703.html#a996023
nabble.com is apparently calling this mailing list "the gcc - General
forum", which is wrong. It is only for developers and testers of the
gcc compiler itself; it is not a place for developers who merely use
gcc to write programs to get their questions answered, except for those
questions that are so technical that only compiler developers can answer.