🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2096

Re: Array size checks

#2096
From: Dave Eisen
Date: Mon, 09 Nov 1992 19:21
23 lines
1286 bytes
In article <BxGnB6.5nt@dcs.ed.ac.uk> mikef@dcs.ed.ac.uk (Mike Fourman) writes:
>
>int big_array[10] ;
>void function_using_small_array( int argument_array[5] ) ;
>
>Do any compilers warn about this usage? Shouldn't they?
>

Yeah, I think they should. Because while what you wrote is
perfectly legal and standard C, it is probably not what you 
meant. Compilers are free to warn about anything they like,
as long as they generate correct code for these legal, but
dubious, constructs. 

I have no idea if in fact any compilers do warn about this 
usage.


-- 
Dave Eisen                               Sequoia Peripherals: (415) 967-5644
dkeisen@leland.Stanford.EDU              Home:                (415) 321-5154
       There's something in my library to offend everybody. 
          --- Washington Coalition Against Censorship
Technical Details
Message-ID: <1992Nov9.192155.4819@leland.Stanford.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!usenet.ins.cwru.edu!agate!stanford.edu!leland.Stanford.EDU!dkeisen
References: <BxGnB6.5nt@dcs.ed.ac.uk>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c,comp.lang.c
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!usenet.ins.cwru.edu!agate!stanford.edu!leland.Stanford.EDU!dkeisen
From: dkeisen@leland.Stanford.EDU (Dave Eisen)
Subject: Re: Array size checks
Message-ID: <1992Nov9.192155.4819@leland.Stanford.EDU>
Sender: news@leland.Stanford.EDU (Mr News)
Organization: Sequoia Peripherals, Inc.
References: <BxGnB6.5nt@dcs.ed.ac.uk>
Date: Mon, 9 Nov 92 19:21:55 GMT
Lines: 23