Path: utzoo!mnetor!uunet!littlei!martin From: martin@littlei.UUCP (martin) Newsgroups: comp.sources.bugs Subject: pointer checking Message-ID: <228@gandalf.littlei.UUCP> Date: 16 Feb 88 18:29:18 GMT Organization: Intel Corp., ISO Systems Development, Hillsboro, OR Lines: 29 Keywords: 16 bits vs 32 bits 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. The material I am referencing is the latest software called "perl". 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 } if (ptr != (char *)NULL) { /* RIGHT !!!!!! */ do something } If you want people to use your software, then write it so that it can be ported easier. Standard disclaimer applies.