Path: utzoo!utgpu!water!watmath!clyde!rutgers!im4u!ut-sally!ut-emx!infotel!pollux!ti-csl!tifsie!kent From: kent@tifsie.UUCP (Russell Kent) Newsgroups: comp.os.minix Subject: Re: Some miscellaneous Minix fixes/improvements Message-ID: <281@tifsie.UUCP> Date: 18 Jan 88 23:58:39 GMT References: <1503@ea.ecn.purdue.edu> Organization: TI Process Automation Center, Dallas Texas Lines: 44 Posted: Mon Jan 18 17:58:39 1988 I compliment Peter on his thorough and precise postings!! (Don't we all wish that all postings were so jam-packed with info!! :-). Unfortunately, I must take issue with this particular statement: > CC/CEM/CG > Like most people, I'm still using the 1.1 C compiler. I don't know > if these are fixed for 1.2, but... > The first problem is that constructs like: > > char months[12][3] = { > "Jan", "Feb", "Mar", "Apr", "May", "Jun", > "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" > }; > > include the nulls ("\0") at the end of the initializer strings, which > is incorrect. > Peter S. Housel housel@ei.ecn.purdue.edu > ...!{inuxc,decvax,...}!pur-ee!housel I refer you to the C bible (Kernighan & Ritchie) page 84: "It is an error to have too many initializers." ... "Character arrays are a special case of initialization; a string may be used instead of the braces and commas notation: char pattern[] = "the"; This is shorthand for the longer but equivalent char pattern[] = { 't', 'h', 'e', '\0' };" Based on the above statements, then the compiler, when faced with Peter's "months" multi-dimensional array should have belched something to the effect of: ###:Invalid initialization: too many initializers In all other respects, Peter's postings are accurate to the best of my knowledge. Russell Kent Phone: +1 214 995 3501 Texas Instruments UUCP address: P.O. Box 655012 MS 3635 ...!convex!smu!tifsie!kent Dallas, TX 75265 ...!ut-sally!im4u!ti-csl!tifsie!kent -- Russell Kent Phone: +1 214 995 3501 Texas Instruments UUCP address: P.O. Box 655012 MS 3635 ...!convex!smu!tifsie!kent Dallas, TX 75265 ...!ut-sally!im4u!ti-csl!tifsie!kent