Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!rbj@icst-cmr.arpa From: rbj@icst-cmr.arpa (Root Boy Jim) Newsgroups: comp.sources.bugs Subject: pointer checking Message-ID: <11878@brl-adm.ARPA> Date: 17 Feb 88 21:44:50 GMT Sender: news@brl-adm.ARPA Lines: 44 I do not want to start another net wars, but I am tired of seeing people write programs that are non-portable between C compilers. You had better go check your facts, because you are dead wrong. The material I am referencing is the latest software called "perl". Larry Wall, the author, takes great pains to allow his software to run in incredibly diverse environments. Look at the configure script. If you look at the source you will see that the authors blatenly compaired pointers to zero without thinking what happens if sizeof(ptr) != sizeof(int). I know that C does not gripe if you do something like this, but can't people program better? Example: char *ptr; if (ptr) { /* WRONG !!!!!! */ do something } YOU are wrong. This has always been allowed. if (ptr != (char *)NULL) { /* RIGHT !!!!!! */ do something } Also correct, altho the cast is really not needed. If you want people to use your software, then write it so that it can be ported easier. Does your compiler barf? If so, it is incorrect. Standard disclaimer applies. (Root Boy) Jim Cottrell National Bureau of Standards Flamer's Hotline: (301) 975-5688 I'm into SOFTWARE!