Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!gargoyle!mason From: mason@gargoyle.UUCP Newsgroups: comp.lang.c Subject: Re: default initialization of static and extern Message-ID: <675@gargoyle.UChicago.EDU> Date: Wed, 3-Jun-87 15:39:55 EDT Article-I.D.: gargoyle.675 Posted: Wed Jun 3 15:39:55 1987 Date-Received: Sat, 6-Jun-87 02:03:56 EDT References: <158@delftcc.UUCP> <1070@viper.Lynx.MN.ORG> <1297@genrad.UUCP> Reply-To: mason@gargoyle.uchicago.edu.UUCP (Tony Mason) Organization: U. of Chicago, Computer Science Dept. Lines: 17 Keywords: C, NULL, portability In article <1297@genrad.UUCP> rep@genrad.UUCP (Pete Peterson) writes: >K&R claims (in at least 3 places) that externs and statics are >guaranteed to be initialized to zero in the absence of any explicit >initializations. "The C Programming Language -- Reference Manual" by >Ritchie as distributed with the BSD documentation makes the same statement. > >Are there really compilers which violate this specification? Sure are. The Whitesmith's Compiler used to do this (it was Version 6 based and explicitly stated that it deviated from K&R in this respect.) I have never seen any other compiler that didn't conform to this convention, but it is best never to assume anything. Tony Mason Univ. of Chicago, Dept. of C.S. ARPA: mason@gargoyle.uchicago.edu UUCP: ...ihnp4!gargoyle!mason