Path: utzoo!attcan!uunet!lll-winken!csd4.milw.wisc.edu!leah!rpi!rpi.edu!deven From: deven@pawl.rpi.edu (Deven Corzine) Newsgroups: comp.sys.amiga Subject: Lattice C V5.0 #include bug Message-ID: Date: 1 Mar 89 23:30:38 GMT Sender: usenet@rpi.edu Reply-To: shadow@pawl.rpi.edu Distribution: na Organization: RPI Public Access Workstation Lab, Troy NY Lines: 70 Just a quick note - the setjmp.h include file distributed with V5.0 of Lattice C begins with: #ifndef __setjmp_h #define __setjmp_h 1 but does not have the corresponding #endif. It's a minor bug that may have been fixed in V5.02, but it a sort that could slip by unnoticed for quite a long time. I expect that if a program had 2 #include lines in it, everything after the second #include would be ignored as part of the #ifndef ... #endif. Actually, it would seem to make the most sense for Lattice to adopt the conventions of the Amiga includes (exec/*, libraries/*, etc.) and make it #ifndef SETJMP_H #define SETJMP_H . . . #endif /* SETJMP_H */ IMHO. I noticed in the exec/types.h: ----------------------------------------------------------------------- typedef unsigned char *STRPTR; /* string pointer */ typedef STRPTR *APTR; /* absolute memory pointer */ /* sigh. APTR was misdefined, but compatibility rules. Heres what it * should have been */ typedef ULONG CPTR; /* absolute memory pointer */ ----------------------------------------------------------------------- When I first saw that declaration for APTR a while back, it baffled me that (unsigned char **) was being declared as a generic absolute memory pointer. This change makes more sense, but now CPTR isn't even a pointer; it's only an unsigned long. Granted, under the Amiga's architecture, a pointer is always 4 bytes, as is a long, but if it were later changed to, say, a 64-bit address space (probably not a too-soon occurance, but not improbable, eventually.) this declaration would break, while the former APTR declaration, while still not quite right, would indeed work, as it IS a memory pointer. Anyway, my point is, shouldn't it be: typedef void *APTR /* absolute memory pointer */ -or- typedef char *APTR /* absolute memory pointer */ ? Or am I missing something? One question - is it possible to create a compiled C module which can be linked alone, without being linked to the lib:c.o startup module or the lib: libraries? (Clearly the libraries can be ditched if nothing in them is used. The question is whether or not you MUST use assembly for the startup module...) Deven -- ------- shadow@pawl.rpi.edu ------- Deven Thomas Corzine --------------------- Cogito shadow@acm.rpi.edu 2346 15th Street Pi-Rho America ergo userfxb6@rpitsmts.bitnet Troy, NY 12180-2306 (518) 272-5847 sum... In the immortal words of Socrates: "I drank what?" ...I think.