Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!ig!jade!ucbvax!HNYKUN11.BITNET!U613042 From: U613042@HNYKUN11.BITNET (Olaf Seibert) Newsgroups: comp.sys.amiga Subject: More about PDC Message-ID: <8712091931.AA10268@jade.berkeley.edu> Date: 9 Dec 87 19:16:57 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 48 [ line ] The PD C compiler has some slight bugs and 'unimplemented features'. To summarize the ones I found the last 3 days: - If you use a switch statement with a 'default' case, the instructions for that case won't be optimized. This is incorrect and won't work. If you turn off the optimization, this problem is no more there, but code quality degrades badly. - It passes arguments to functions in a slightly non-standard way. Non-constant short/char expressions are not extended to integers, but passed as shorts (2 bytes). The function expects short and char arguments this way. On the other hand, CONSTANT short/char expressions are cast to ints (4 bytes) as they should be. (They always are, anyway). . This may confuse the called function, however. Note that Jeff Lydiatt (the porter) notices problems here but just got is backwards. - Subtraction of pointers is not implemented. As soon as the parser sees a pointer, it assumes the number to be added/subtracted is an integer. If that really is a pointer, it starts doing funny things. Try the following program: main() int i; char c1, c2; i = &c2 - &c1; Note that this crashes Manx 3.4a (but not 3.4b) with a division by zero. - Ints are fairly hardcoded to be longs. I would like this to be user- selectable with a command line option (or maybe even a #pragma), but this is something that I should be able to do myself. - sizeof(variable) is not implemented. The compiler never says it is, however, and sizeof(type) works. - I am sure more bugs will turn up as I (and others) look more closely to the thing. In its defense can be said that when it produces correct code, which it does most of the time, it is better than the code generated by the Manx compiler (don't know about the current Lattice code quality). Maybe more later.... --- The opinions possibly reflected herein are my own, and not necessarily those of someone else I might be connected with. They MAY, however, be. >>> I *thought* I was living in a free, modern country.... --- Olaf (Rhialto) Seibert... U613042@HNYKUN11.BITNET USEnet is *almost* an anagram of unsent ... BITnet: Because It's There Computers? Just say *YES*! Customs? Just say *NO*!