From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 19053 invoked from network); 20 Nov 1998 18:53:44 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 20 Nov 1998 18:53:44 -0000 Received: from ursa.calvin.edu (ursa.calvin.edu [153.106.4.1]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id NAA22078 for ; Fri, 20 Nov 1998 13:53:41 -0500 Received: from localhost (jdemaa17@localhost) by ursa.calvin.edu (8.8.7/8.8.7) with ESMTP id NAA26697 for ; Fri, 20 Nov 1998 13:53:46 -0500 (EST) Date: Fri, 20 Nov 1998 13:53:46 -0500 (EST) From: Jeff DeMaagd To: axp-list@redhat.com Subject: Re: Writing portable Code for Glibc and 32/64 bit In-Reply-To: <36558486.13728473@iis.fhg.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 20 Nov 1998, Stefan Schroepfer wrote: > I'm not aware of a paper, but the following rules may serve as a > starting point: > - Don't store pointers in ints (it should be safe to use unsigned > longs for this purpose, but why not use pointer variables). Rather goofy that a compiler ever lets that happen. So much for the goal of 'easy portability'. Goofier yet is that people that think themselves as competent programmers do this. > - Don't make assumptions on the size of data types, always use > the sizeof () operator. Oh, that's why it's in the language! :) > - Avoid assembly language. I don't mind assembly language, just make sure there are IFNDEF's for general purpose code too. Makes maintainance a bit harder, but sometimes raw performance matters. :) > > for a friend that has to implement transparent network cryptography for > > Linux soon: Where can I find documents that tell him how to code > > good, portable code for glibc and 32/64 bit Linux? It there a quick > > introductory paper to the most important things to remember and a longer > > one explaning what to do and what not? JRDM