From: Wolfgang Lux <lux@wi.uni-muenster.de>
To: "Warp" <warplayer@free.fr>
Cc: "Andreas Rossberg" <rossberg@ps.uni-sb.de>, "OCaml" <caml-list@inria.fr>
Subject: Re: [Caml-list] More OCaml+windowing system questions
Date: Tue, 15 Jan 2002 17:26:41 +0100 [thread overview]
Message-ID: <200201151626.g0FGQmb22417@concorde.inria.fr> (raw)
In-Reply-To: Message from "Warp" <warplayer@free.fr> of "Tue, 15 Jan 2002 16:32:50 +0100." <005901c19dd9$e7837260$9600a8c0@warp>
"Warp" wrote
> I think that all the features of the C/C++ languages ARE portable. Why
> shouldn't they be ? All you have to do is to compile with the good compiler
Because they are machine dependent by definition. For example the C standards
have nothing to say about the size of an int or a short (except that
sizeof(int) >= sizeof(short)). Depending on the architecture, compiler, and
even programming model, int i = 1; i <<= 32; will either set i to 0 or to
0x100000000 (even for gcc). Neither can you rely on the order of bytes in an
integer (and casting an int* into a char* is certainly not forbidden by the
standard) etc.
> ( gcc for instance ). BUT then, you have to be aware of some things that are
> not permitted ( like DWORD access on odd memory addresses on Solaris ) and
> to use a portable API - like ACE, or OpenGL - to do "special" things. In
> fact, the limits of portability C/C++ are in the choice of the API you make,
> and in the fact you CAN write very-low-level code when you should use an
> API.
No one is claiming that you cannot write portable code in C, you just have to
take care and restrict yourself to the portable subset of C (or resort to some
preprocessor magic in order to adapt to different platforms.)
Wolfgang
--
Wolfgang Lux Phone: +49-251-83-38263
Institut fuer Wirtschaftinformatik FAX: +49-251-83-38259
Universitaet Muenster Email: wlux@uni-muenster.de
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
prev parent reply other threads:[~2002-01-15 18:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-15 9:40 Walter B. Rader
2002-01-15 10:24 ` Xavier Leroy
2002-01-15 10:48 ` Andreas Rossberg
2002-01-15 15:32 ` Warp
2002-01-15 16:26 ` Wolfgang Lux [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200201151626.g0FGQmb22417@concorde.inria.fr \
--to=lux@wi.uni-muenster.de \
--cc=caml-list@inria.fr \
--cc=rossberg@ps.uni-sb.de \
--cc=warplayer@free.fr \
--cc=wlux@uni-muenster.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox