[fpc-devel] Address size compiler

Kostas Michalopoulos badsectoracula at gmail.com
Wed Nov 19 18:21:29 CET 2014


Yes this is what i meant. I'd expect that the sizeof(pointer) to return the
target architecture's pointer size, not the architecture of the compiler's
own executable.

On Wed, Nov 19, 2014 at 5:22 PM, Sven Barth <pascaldragon at googlemail.com>
wrote:

> Am 19.11.2014 16:15 schrieb "Kostas Michalopoulos" <
> badsectoracula at gmail.com>:
> >
> >
> > On Mon, Nov 10, 2014 at 4:07 PM, Michael Van Canneyt <
> michael at freepascal.org> wrote:
> >>
> >>
> >> For a cross-compiler,  sizeof(pointer) <> sizeof(pointer on target arch)
> >
> >
> > So wait, the following code:
> >
> > {$if sizeof(pointer)=8} Code1 {$elseif sizeof(pointer)=4} Code2 {$endif}
>
> Michael's message wasn't meant as literal code. A compiler compiled for
> x86_64 will have sizeof(pointer)=8, but the pointer size of the target
> architecture (AFAIK called "aint" in the compiler, but I'm not sure
> currently) might be different from that, so inside the compiler One should
> know exactly which kind of Pointer one is talking about.
>
> Regards,
> Sven
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20141119/a70c072c/attachment.html>


More information about the fpc-devel mailing list