From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA16017; Tue, 15 Jan 2002 19:08:15 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA15930 for caml-list@pauillac.inria.fr; Tue, 15 Jan 2002 19:08:15 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA12895 for ; Tue, 15 Jan 2002 17:26:48 +0100 (MET) Received: from wildcat.uni-muenster.de (WI.UNI-MUENSTER.DE [128.176.159.139]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g0FGQmb22417 for ; Tue, 15 Jan 2002 17:26:48 +0100 (MET) Message-Id: <200201151626.g0FGQmb22417@concorde.inria.fr> Received: from wi.uni-muenster.de (128.176.158.97 [128.176.158.97]) by wildcat.uni-muenster.de with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id YWYS5Z53; Tue, 15 Jan 2002 17:26:47 +0100 X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0 To: "Warp" cc: "Andreas Rossberg" , "OCaml" Subject: Re: [Caml-list] More OCaml+windowing system questions In-Reply-To: Message from "Warp" of "Tue, 15 Jan 2002 16:32:50 +0100." <005901c19dd9$e7837260$9600a8c0@warp> References: <3C4408E0.EB34C3B2@ps.uni-sb.de> <005901c19dd9$e7837260$9600a8c0@warp> Reply-to: wlux@uni-muenster.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 15 Jan 2002 17:26:41 +0100 From: Wolfgang Lux Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk "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