home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / std / c / 2997 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.3 KB

  1. Xref: sparky comp.std.c:2997 comp.lang.c:16231
  2. Newsgroups: comp.std.c,comp.lang.c
  3. Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!stanford.edu!leland.Stanford.EDU!dkeisen
  4. From: dkeisen@leland.Stanford.EDU (Dave Eisen)
  5. Subject: Re: Array size checks
  6. Message-ID: <1992Nov9.192155.4819@leland.Stanford.EDU>
  7. Sender: news@leland.Stanford.EDU (Mr News)
  8. Organization: Sequoia Peripherals, Inc.
  9. References: <BxGnB6.5nt@dcs.ed.ac.uk>
  10. Date: Mon, 9 Nov 92 19:21:55 GMT
  11. Lines: 23
  12.  
  13. In article <BxGnB6.5nt@dcs.ed.ac.uk> mikef@dcs.ed.ac.uk (Mike Fourman) writes:
  14. >
  15. >int big_array[10] ;
  16. >void function_using_small_array( int argument_array[5] ) ;
  17. >
  18. >Do any compilers warn about this usage? Shouldn't they?
  19. >
  20.  
  21. Yeah, I think they should. Because while what you wrote is
  22. perfectly legal and standard C, it is probably not what you 
  23. meant. Compilers are free to warn about anything they like,
  24. as long as they generate correct code for these legal, but
  25. dubious, constructs. 
  26.  
  27. I have no idea if in fact any compilers do warn about this 
  28. usage.
  29.  
  30.  
  31. -- 
  32. Dave Eisen                               Sequoia Peripherals: (415) 967-5644
  33. dkeisen@leland.Stanford.EDU              Home:                (415) 321-5154
  34.        There's something in my library to offend everybody. 
  35.           --- Washington Coalition Against Censorship
  36.