From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,379448a54fafa5c9 X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,14e882a2e94c4748 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1051a8,dd67877c854c94c4 X-Google-Attributes: gid1051a8,public X-Google-Thread: 110292,dd67877c854c94c4 X-Google-Attributes: gid110292,public From: "Eric D. Osborne" Subject: Re: What Does DEC Have Left? (was: Current Unpleasantness Resolved) Date: 1997/11/24 Message-ID: <3479303C.B86@mail.dec.com>#1/1 X-Deja-AN: 292164891 References: <63d177$ri9@flonk.uk.sun.com> <346C4EA7.358C8E67@yes.optus.com.au> <64ia1i$of4$2@joe.rice.edu> <34753FEF.1EB6@mail.dec.com> <654lek$ajm$1@flea.best.net> Organization: Digital Equipment Corporation Reply-To: osborneer@mail.dec.com Newsgroups: comp.os.vms,comp.sys.dec,comp.sys.intel,comp.sys.mips Matt Dillon wrote: > This is not broken. This is why you use prototypes and compile -Wall > -Wstrict-prototypes ... to allow the compiler to cast the arguments > properly for the call. This is, in fact, one of the primary purposes > behind ANSI prototypes and procedure argument specification. > To require that exactly the right integer type be passed to a procedure > is not good coding practice, it's a pain in the ass and totally > non-portable across operating systems. Even with the mandated library > call typing, there are hundreds of other libraries out there unrelated > to the ANSI spec that one must deal with. Matt : I think we're in a sort of violent agreement, with perhaps slightly different viewpoints/philosophies. In your example, you are forcing the compiler to do the casting of the parameters, and in mine I used explicit casts. The net message remains the same. One way or another, you have to ensure that the correct type is passed. If you just trust this stuff to luck, you're writing bad code. And if you do it right, you don't have any problems with portability. The original message of the post I was responding to was that Digital UNIX is inherently incompatible with other UNIX implementations. It is, in fact, not so. My examples were intended to explicitly demonstrate that Digital UNIX does, indeed, use EXACTLY the same data types as do other POSIX compliant UNIX variants within these calls. Having said that, you're right - variations in C language implementation, library implementation, etc., can make it difficult to deal with some of these portability issues in going between disparate operating systems. And using the techniques you described can, in fact, help a lot. That doesn't diminish the importance of my point about DU being unfairly maligned for lack of standards compliance. DU maintains compliance as good as or better than anything out there. And it shouldn't be blamed when poorly written code doesn't port well. Eric D. Osborne The opinions expressed above are my own, and should not be interpreted as an official statement by Digital Equipment Corporation.