This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pointers in comparison expressions


Joe Buck <Joe.Buck@synopsys.COM> writes:

> On Wed, Jul 13, 2005 at 12:38:11AM +0200, Falk Hueffner wrote:
>> Erik Trulsson <ertr1013@student.uu.se> writes:
>> > I believe most C compilers support it in practice, but few, if any, have
>> > actually documented it as a supported extension to C.
>> 
>> I don't think we should, either. People who want to do this can just
>> cast both pointers to size_t.
>
> If you want to be pedantic, that's not portable; in particular, it
> will break for some of the memory models used with 16-bit Windows

You're missing my point; size_t was just an example, whoever does this
will know what the correct type is for their system.  All I'm saying
is that we shouldn't go to the trouble to document and kick along some
language extension, maybe even miss some optimization because of it,
when there's a perfectly fine alternative to it for the user.

-- 
	Falk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]