Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!dciem!nrcaer!cognos!brianc From: brianc@cognos.uucp (Brian Campbell) Newsgroups: comp.lang.c Subject: Re: Passing (char *) NULL to printf to match %s Message-ID: <1219@cognos.UUCP> Date: Tue, 4-Aug-87 10:02:26 EDT Article-I.D.: cognos.1219 Posted: Tue Aug 4 10:02:26 1987 Date-Received: Sat, 8-Aug-87 07:21:13 EDT References: <166@qetzal.UUCP> <157@hobbes.UUCP> <875@bsu-cs.UUCP> Reply-To: brianc@cognos.UUCP (Brian Campbell) Organization: Cognos Incorporated, Ottawa, Canada Lines: 16 In article <875@bsu-cs.UUCP> dhesi@bsu-cs.UUCP (Rahul Dhesi) writes: ! I believe that the interpretation of (char *) NULL when supplied as the ! actual parameter where printf is looking for a string may have changed ! over the years. The "correct" behavior today, according to ANSI C as ! I know it, is for printf to print a token signifying that a NULL ! pointer was passed. Microsoft C will print the string "(null)" when ! this happens. However my System V Release 2 manual as supplied with Speaking of this... has anyone else noticed any problems with this in small model Microsoft C? I seem to be unable to print out a string that happens to be placed at offset 0 of the data segment -- MSC's libraries decide it is a null pointer and format it as "(null)". -- Brian Campbell uucp: decvax!utzoo!dciem!nrcaer!cognos!brianc Cognos Incorporated mail: 3755 Riverside Drive, Ottawa, Ontario, K1G 3N3 (613) 738-1440 fido: sysop@163/8