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: Size of basic types


dewar@adacore.com (Robert Dewar)  wrote on 03.12.04 in <41B14380.50307@adacore.com>:

> Paul Schlie wrote:
>
> > Thanks, I didn't appreciate that there was a dependency between the size
> > of a pointer and the size of a long; I had mistakenly presumed that as
> > long as there was a supported int datatype which was at least as large as
> > a pointer (as in the above example long long == pointer size) GCC's
> > infrastructure would support it.
>
> Zack did not say that GCC could not support it, just that it would be
> essentially a new port and a huge amount of work, and that it *might*
> be the case that breaking the pointer/long assumption would cause
> further difficulties.
>
> That seems a fair analysis to me ...

Well, it *might* break gcc; it *will* break a lot of programs who relied  
on the promises of C90.

We've had that discussion lots of time before in various different places.

For example, you can't cast a pointer, ptrdiff_t, size_t, or ssize_t to  
long without losing information in that model. Lots of source code does  
exactly that, for a number of different reasons, because before C99 that  
was guaranteed to work. (Don't forget that C90 didn't have long long.)

MfG Kai


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