From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 100159,805e0071ac25e02c X-Google-Attributes: gid100159,public X-Google-Thread: fcda7,805e0071ac25e02c X-Google-Attributes: gidfcda7,public X-Google-Thread: fc89c,805e0071ac25e02c X-Google-Attributes: gidfc89c,public X-Google-Thread: f6653,805e0071ac25e02c X-Google-Attributes: gidf6653,public X-Google-Thread: 115614,805e0071ac25e02c X-Google-Attributes: gid115614,public X-Google-Thread: 10650a,805e0071ac25e02c X-Google-Attributes: gid10650a,public X-Google-Thread: 11035d,805e0071ac25e02c X-Google-Attributes: gid11035d,public X-Google-Thread: fee84,805e0071ac25e02c X-Google-Attributes: gidfee84,public From: singular@oort.ap.sissa.it (Poll Dubh) Subject: Re: best UNIX OS as primary platform for UNIX system software develpoment? Date: 1996/09/03 Message-ID: <50hogq$j2k@sv8.ictp.trieste.it>#1/1 X-Deja-AN: 178214050 distribution: inet references: <4v2j4b$2bs@knot.queensu.ca> <322C385A.1AB4@noran.com> organization: Lasciate ogni speranza voi ch'entrate newsgroups: comp.unix.solaris,comp.sys.sun.misc,comp.sys.hp.hpux,comp.unix.internals,comp.unix.programmer,comp.unix.aix,comp.unix.osf.osf1,comp.sys.sgi.misc >mib@ppe.bb-data.de wrote: >> wjjr@sapphire.alisa.org (John J. Rushford) writes: >> > sizeof(int) == sizeof(long) is true on a lot of UNIX platforms not just Linux >> > or Solaris x86 and has been for a long time. Just curious as to why you use >> > this criteria to judge which OS to use. >> Take another look at the subject. For primary development, use the >> platform that is most unforgiving when it comes to coding errors, and >> port to more lenient platforms. The other way around it is a nightmare (believe >> me--I've been there). Two of the most frequent coding errors in the >> UNIX developer community (precisely because it is, as you say, common >> to have int and long to be identical) is to confuse ints and longs, >> especially when it comes to passing parameters, mixing pointers, and >> *printf formats, and "tunneling" pointer values through int variables >> and arguments. Try porting a 100.000+ lines of code application laced >> with these bugs to Digital Unix *shudder*. If you code for dUNIX >> first, you'll catch these buggers up-front. Plus, you learn to avoid them. A good compiler will warn you about these things. My makefiles tend to have CC=gcc -ansi -pedantic -Wall -Wtraditional -Wpointer-arith -Wcast-qual \ -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes \ -Wmissing-prototypes -Waggregate-return (and also -fshort-enums, but that's besides the point). Parameter passing? Anything without a prototype will be flagged. Prototype mismatches will be flagged. Cases where old K&R C would implicitly change the passed type are flagged. Mixing pointers? Will be flagged too, albeit perhaps not quite as strictly as with IBM's XL compilers for AIX. *printf formats? Mismatches between int and long int are flagged. Since gcc runs on many platforms, the only factor left is the quality of each platform's /usr/include header files. I'm not sure which is most unforgiving.