Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!iconsys!caeco!i-core!geo-works!bryan From: bryan@geo-works.UUCP (Bryan Ford) Newsgroups: comp.sys.amiga.tech Subject: Re: Lattice C 5.02 REVIEW, By Matthew Dillon Message-ID: <1449.AA1449@geo-works> Date: 12 Jul 89 01:17:12 GMT References: <8906300558.AA12963@postgres.Berkeley.EDU> Followup-To: comp.sys.amiga.tech Lines: 82 In article <8906300558.AA12963@postgres.Berkeley.EDU>, Matt Dillon writes: > __asm -These allow you to specify that subroutines takes > __d0 to __d7, parameters in specific registers instead of on the > stack > __a0 to __a6 > > __asm blah (register __d0 int a, register __a0 int *b); > > currently you may only declare that data registers pass > non pointers and address registers pass pointers. Interesting fact: I tried violating this rule both directions (data register into pointer and address register into non-pointer), and the compiler didn't give me any errors at all. Data registers into pointers worked perfectly, but if you try putting an address register into a non-pointer, it gets it out of the corresponding data register (i.e., d1 if you specified a1). > The -rrb option (generate both registerized (@) and nonregisterized (_) > entry points) does not work. It gets the labels mixed up (I caught > that one *real* fast!). Clarification: It swaps the @ and _ labels when it defines functions which can be called externally. However, a function which calls another function above it (Pascal style) in the same module doesn't use the labels and so works perfectly. When I first tried using this feature I used it on a single-module program and it worked perfectly, but when I tried using it on a multi-module program it crashed, which is to be expected. Also, note that using this will increase code size slightly because of the extra instructions to pull stack-based variables off the stack, but won't affect speed at all. > Precompiled include files don't appear to work 100%. I couldn't pin > it down, but apparently #pragmas would be lost from time to time, and > maybe some prototypes too. I found a really interesting problem (but haven't been able to find out the cause). When I tried using the DateStamp structure in one of my programs in a way in which it was necessary to have the structure actually defined (not just pointer manipulation), it said that the structure was not defined (although it was, in the precompiled symbol table). I tried to kludge it by copying the definition of the DateStamp structure out of libraries/dos.h into my code. It didn't tell me that the structure wasn't defined, but it *did* tell me that the three elements (ds_Days, ds_Minute, ds_Tick) were already defined within the structure. So I just took the ds_ thingies off the names just to create unique names and it worked fine. (Although I don't think I ever accessed the elements directly, I just defined an instance of the structure in my program, and that's what set the whole thing off.) > (5) Since functions are prototyped, you get many more warning > messages about ptr->ptr conversion. For ARGUMENTS to functions > now. I talked to John Toebes on this point and he already had > some good ideas on how to fix it. I'm pretty sure there are separate warning numbers (but with the same messages attached) for argument and assignment pointer conversions, so you should be able to disable one without affecting the other. (#30 is for assignments and #88 is for arguments.) > Final note: Note that Lattice C also comes with an object module > librarian, object module disassembler, assembler, the latest BLink, > grep, diff, and many other utilities including an editor (but I just > use DME so I can't comment on their editor). Manx C, at least the > package I got, came with an equally prolific set of utilities. Their editor is pretty good, --> for an editor that comes as part of a package <--. It's definitely easier for beginners than DME, but a lot less powerful and a lot bigger (because of all the menus and messages and things). It *does* create an integrated environment, though (resident the compiler and stuff and compile in memory). Of course you can do this with ARexx anyway. :-) Bryan -- ____________________________________________ _/ Bryan Ford - bryan@geo-works.geo-works.com \_ _/ ..!utah-cs!caeco!i-core!geo-works!bryan \_ / ..!uunet!iconsys!caeco!i-core!geo-works!bryan \