Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-06 Thread Dave Dodge
On Thu, Sep 06, 2007 at 02:13:53AM -0500, Rob Landley wrote: > On Wednesday 05 September 2007 9:55:43 pm Dave Dodge wrote: > > Cray had some architectures with 64-bit bytes, but simulated 8-bit > > bytes in userspace by using otherwise-unused high bits in a pointer to [...] > Again, does Linux run

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-06 Thread Rob Landley
On Wednesday 05 September 2007 9:55:43 pm Dave Dodge wrote: > On Wed, Sep 05, 2007 at 06:17:38PM -0500, Rob Landley wrote: > > On Wednesday 05 September 2007 5:32:06 pm Dave Dodge wrote: > > > For Linux certainly. My understanding is that there are current > > > architectures in the embedded marke

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-05 Thread Rob Landley
On Wednesday 05 September 2007 6:29:04 pm Rob Landley wrote: > On Wednesday 05 September 2007 6:17:38 pm Rob Landley wrote: > > Hang on, so when char *a is constant, (int)a is _not_ constant? > > > > How does that work? > > Looking back at it, I think what the standard means is since the actual > a

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-05 Thread Dave Dodge
On Wed, Sep 05, 2007 at 06:17:38PM -0500, Rob Landley wrote: > On Wednesday 05 September 2007 5:32:06 pm Dave Dodge wrote: > > For Linux certainly. My understanding is that there are current > > architectures in the embedded market that use a 32-bit char, though. > > I haven't heard of them, and

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-05 Thread Simon 'corecode' Schubert
Rob Landley wrote: On Wednesday 05 September 2007 6:17:38 pm Rob Landley wrote: Hang on, so when char *a is constant, (int)a is _not_ constant? How does that work? Looking back at it, I think what the standard means is since the actual address of the char * is supplied by the linker, than de

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-05 Thread Rob Landley
On Wednesday 05 September 2007 6:17:38 pm Rob Landley wrote: > Hang on, so when char *a is constant, (int)a is _not_ constant? > > How does that work? Looking back at it, I think what the standard means is since the actual address of the char * is supplied by the linker, than despite it being a

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-05 Thread Rob Landley
On Wednesday 05 September 2007 5:32:06 pm Dave Dodge wrote: > On Wed, Sep 05, 2007 at 12:46:00PM -0500, Rob Landley wrote: > > On Wednesday 05 September 2007 3:25:59 am Dave Dodge wrote: > > > Pretty much the only way it seems to allow using a > > > pointer/address to an object _anywhere_ in a cons

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-05 Thread Dave Dodge
On Wed, Sep 05, 2007 at 12:46:00PM -0500, Rob Landley wrote: > On Wednesday 05 September 2007 3:25:59 am Dave Dodge wrote: > > Pretty much the only way it seems to allow using a > > pointer/address to an object _anywhere_ in a constant expression is in > > sizeof context, or when the final express

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-05 Thread Rob Landley
On Wednesday 05 September 2007 5:27:46 am Gregg Reynolds wrote: > On 9/5/07, Rob Landley <[EMAIL PROTECTED]> wrote: > > On Wednesday 05 September 2007 1:02:03 am Dave Dodge wrote: > > > > I fixed the "ptr || ptr" bit not working (check hg), and I just made > > > > it stop warning me about "comparis

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-05 Thread Rob Landley
On Wednesday 05 September 2007 3:25:59 am Dave Dodge wrote: > On Wed, Sep 05, 2007 at 02:33:58AM -0500, Rob Landley wrote: > > On Wednesday 05 September 2007 1:02:03 am Dave Dodge wrote: > > > > I fixed the "ptr || ptr" bit not working (check hg), and I just made > > > > it stop warning me about "c

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-05 Thread Gregg Reynolds
On 9/5/07, Rob Landley <[EMAIL PROTECTED]> wrote: > On Wednesday 05 September 2007 1:02:03 am Dave Dodge wrote: > > > 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 "in

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-05 Thread Dave Dodge
On Wed, Sep 05, 2007 at 02:33:58AM -0500, Rob Landley wrote: > On Wednesday 05 September 2007 1:02:03 am Dave Dodge wrote: > > > 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

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-05 Thread Rob Landley
On Wednesday 05 September 2007 1:02:03 am Dave Dodge wrote: > > 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,

Re: [Tinycc-devel] More fun with comparison between pointer and integer...

2007-09-04 Thread Dave Dodge
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; >