Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!mcsun!hp4nl!star.cs.vu.nl!ast From: ast@cs.vu.nl (Andy Tanenbaum) Newsgroups: comp.os.minix Subject: Re: Compiling 1.5.0 commands Message-ID: <5451@star.cs.vu.nl> Date: 18 Feb 90 21:12:47 GMT References: <1552@crash.cts.com> Sender: news@cs.vu.nl Organization: Fac. Wiskunde & Informatica, VU, Amsterdam Lines: 41 In article <1552@crash.cts.com> cwr@pnet01.cts.com (Will Rose) writes: >In a recent article, nfs@notecnirp.UUCP (Norbert Schlenker) writes: > >>An extraordinary number of commands generate warnings when compiled, >>most of which are caused by the definition of NULL as ((void *)0). I looked at the cdiffs Norbert posted. About half were real and I incorporated them where they did not conflict with other fixes. The other half were due to POSIX_SOURCE, which should be defined in the Makefile. In any event, it is now. Also, there is one nasty thingie in 1.5.3. In all the ANSI headers except , NULL is defined as ((void *) 0). In it is defined as #ifdef NULL #undef NULL #endif #define NULL 0 This means that a file using gets NULL as a 0, and a file using the other gets it as the void pointer. In case both kinds of headers are used, I carefully put #include last, so you get a true 0. This wreaks havoc with the Atari, so Frans Meulenbroeks and I have put in casts everywhere where it matters. Please DO NOT TELL ME THIS IS AN UGLY HACK. I know very well it is an ugly hack. The problem is that I have gone over to POSIX/ANSI headers for everything except , and the old uses a 0. When our ANSI C compiler is finished, I will go over to its header, and I didn't want to change it twice, once now (e.g., to Earl's) and later to our ANSI C header. Despite the ugliness of this hack, it is essentially temporary, which is why I am not sweating it too much. Since headers are always defined with last, something ANSI clearly allows, all programs are legal now and will remain legal with the ANSI compiler. The only effect this ugliness has now is to require a few casts that might otherwise not be required with an ANSI C compiler and full prototypes. It's not that awful and it will go away eventually. The appearance of 1.5.3 is imminent. Andy Tanenbaum (ast@cs.vu.nl)