dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]stdio in pnetC ... some questions


From: Rhys Weatherley
Subject: Re: [DotGNU]stdio in pnetC ... some questions
Date: Mon, 26 Aug 2002 19:16:51 +1000

Gopal V wrote:

> What I was talking about is the behaviour of compiled programs
> of pnetC .. for example I compile jilc with pnetC on a little-endian
> machine , and I copy the .exe to a big-endian machine ... For gcc it
> is not much of an issue .. as binaries for one machine do not run easily
> on others.

If you build it on a little-endian machine, it should run
on a big-endian machine (IL is designed to be portable).

However, if you inadvertantly introduce a system dependency,
such as fread'ing a structure without performing manual
byte swaps, then the behaviour will be inconsistent on the
two machines.

Using fread on structures is never a good idea, even when
compiling on native systems using gcc.

The cscc compiler outputs portable binaries, but it is still
necessary for the programmer to follow good portable coding
practices.

We can certainly document some of the common pitfalls, and
ways to avoid them.

Cheers,

Rhys.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]