Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!brl-adm!adm!Peter Steele - Acadia\@ From: Peter@adm.UUCP Newsgroups: comp.lang.c Subject: Casting NULL? Message-ID: <3179@brl-adm.ARPA> Date: Thu, 22-Jan-87 19:37:38 EST Article-I.D.: brl-adm.3179 Posted: Thu Jan 22 19:37:38 1987 Date-Received: Fri, 23-Jan-87 21:07:43 EST Sender: news@brl-adm.ARPA Lines: 30 Its me again, although not about my infamous reviewer. I have a question about pointers: I just recently read a C text where whenever NULL was passed as a parameter it was casted to the proper type. For example, if he had void test(pc,pi) char *pc; int *pi; { ... } he would call it as test( (char *)NULL, (char *)NULL ); if the parameters were to be passed as NULL. He claimed that this is required because pointers to different types of objects may not be the same size. I can appreciate this but how common is it really? Are there any byte architectures out there where a pointer to one type of object is a different size than a pointer to another type of object? I know that under MS-DOS, some compilers support so-called "far" declarations, but that's not really the same. Would anyone care to respond? Try sending to me directly to Peter@Acadia.BITNET. If that doesn't work, just post it over info-c. Peter Steele