[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] More fun with comparison between pointer and integer.
From: |
Dave Dodge |
Subject: |
Re: [Tinycc-devel] More fun with comparison between pointer and integer... |
Date: |
Wed, 5 Sep 2007 02:02:03 -0400 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Wed, Sep 05, 2007 at 12:11:01AM -0500, Rob Landley wrote:
> So in my toybox project (which I'm trying to build with tcc), I'm pulling a
> dirty trick to do dead code elimination on gcc. Basically, I have macros
> that boil down to:
>
> static const int blah = ptr || ptr || ptr || ptr || 0;
>
> with the various ptr entries being either a string constant or NULL.
...
> I fixed the "ptr || ptr" bit not working (check hg), and I just made it stop
> warning me about "comparison between pointer and int" for && and ||, but now
> it's saying "initializer element not constant".
Well looking at 6.6, I'm having a hard time figuring out how to fit
the above into one of the described forms of "constant expression".
It's the use of pointers at all that causes the problem; most of the
ways of defining such expressions seem to be constrained to using only
arithmetic types.
I suspect your expression is falling into the gray area of "An
implementation may accept other forms of constant expressions."
-Dave Dodge
- [Tinycc-devel] More fun with comparison between pointer and integer..., Rob Landley, 2007/09/05
- Re: [Tinycc-devel] More fun with comparison between pointer and integer...,
Dave Dodge <=
- Re: [Tinycc-devel] More fun with comparison between pointer and integer..., Rob Landley, 2007/09/05
- Re: [Tinycc-devel] More fun with comparison between pointer and integer..., Dave Dodge, 2007/09/05
- Re: [Tinycc-devel] More fun with comparison between pointer and integer..., Rob Landley, 2007/09/05
- Re: [Tinycc-devel] More fun with comparison between pointer and integer..., Dave Dodge, 2007/09/05
- Re: [Tinycc-devel] More fun with comparison between pointer and integer..., Rob Landley, 2007/09/05
- Re: [Tinycc-devel] More fun with comparison between pointer and integer..., Rob Landley, 2007/09/05
- Re: [Tinycc-devel] More fun with comparison between pointer and integer..., Simon 'corecode' Schubert, 2007/09/05
- Re: [Tinycc-devel] More fun with comparison between pointer and integer..., Rob Landley, 2007/09/06
- Re: [Tinycc-devel] More fun with comparison between pointer and integer..., Dave Dodge, 2007/09/05
- Re: [Tinycc-devel] More fun with comparison between pointer and integer..., Rob Landley, 2007/09/06