[cfe-dev] size of pointer and size of long
Alireza.Moshtaghi at microchip.com
Alireza.Moshtaghi at microchip.com
Thu Oct 23 08:26:51 PDT 2008
I applied the modifications locally as suggested by Eli.
Will check on our port and we will submit the patch.
A.
> -----Original Message-----
> From: Chris Lattner [mailto:clattner at apple.com]
> Sent: Tuesday, October 21, 2008 9:40 PM
> To: Alireza Moshtaghi - C13012
> Cc: cfe-dev at cs.uiuc.edu
> Subject: Re: [cfe-dev] size of pointer and size of long
>
> Eli wrote:
> >> There is an assertion in the Preprocessor.cpp line 600 that assumes
> >> current targets have sizeof(long) == sizeof(void *). This
> >> assumption is
> >> incorrect.
> >
> > Yeah; the only reason Chris did that was to avoid adding a few extra
> > cases to the code. Feel free to submit a patch, or else I'm sure
> > Chris will get to it soon.
>
>
> Right. I just didn't know the logic to infer the preprocessor
> definitions, it should be easy to add that code.
>
> I agree with your type proposal.
>
>
> On Oct 21, 2008, at 9:25 PM, Alireza.Moshtaghi at microchip.com wrote:
>
> > Thanks for the information,
> > For now in PIC16 port, I'll be setting the size of long long to zero
> > and
> > by checking that in Preprocessor.cpp, I know if long long is
supported
> > or not. Tentatively in the place where it is asserting, I'll leaving
> > the
> > current code only for targets that have non zero long long.
> > I don't know if you want me to submit this patch or not. It seems to
> > be
> > working for us at least for now until the final approach is adopted.
>
> Why not just make sizeof(long long) == sizeof(long)? It would be
> nicer to support long long, even if it is the same size as long.
>
> > Regarding your proposal,
> > Similar enum is defined publicly in BuiltinType class. Can't that be
> > used instead of creating a new enum to become source of confusion?
>
> BuiltinType is part of the AST library. TargetInfo is in the "Basic"
> library. Code in 'Basic' can't use enums in AST. Please add a new
> enum to TargetInfo.
>
> Thanks!
>
> -Chris
>
More information about the cfe-dev
mailing list