home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12653 < prev    next >
Encoding:
Internet Message Format  |  1992-08-22  |  1.3 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!dog.ee.lbl.gov!horse.ee.lbl.gov!torek
  2. From: torek@horse.ee.lbl.gov (Chris Torek)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Simple C question
  5. Date: 22 Aug 1992 19:24:31 GMT
  6. Organization: Lawrence Berkeley Laboratory, Berkeley
  7. Lines: 24
  8. Message-ID: <25680@dog.ee.lbl.gov>
  9. References: <_c+nnmp@lynx.unm.edu>
  10. Reply-To: torek@horse.ee.lbl.gov (Chris Torek)
  11. NNTP-Posting-Host: 128.3.112.15
  12.  
  13. In article <_c+nnmp@lynx.unm.edu> rsahu@triton.unm.edu (Raikanta Sahu) writes:
  14. >Distribution: unm
  15. (that distribution worked really well, I see :-) )
  16. >I thought the following piece of code was perfectly legal.
  17.  
  18. It has one bug (it returns a random value from main()), but is otherwise
  19. legal.
  20.  
  21. > char s[] = "Hello world!" ;
  22. >ccom: Error: test.c, line 6: no automatic aggregate initialization
  23.  
  24. You have an legal C program, but an illegal compiler. :-)
  25.  
  26. More precisely, compilers that print
  27.  
  28.     no automatic aggregate initialization
  29.  
  30. are derivatives of the Portable C Compiler (PCC), a rather ancient and
  31. creaky compiler that predates the ANSI C standard by more than a decade.
  32. PCC is nowhere near ANSI-conformant.  Your best bet is to discard the
  33. current system and get one that at least *attempts* to be conformant.
  34. -- 
  35. In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 510 486 5427)
  36. Berkeley, CA        Domain:    torek@ee.lbl.gov
  37.