Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!hp-pcd!hpcvia!brianh From: brianh@hpcvia.CV.HP.COM (brian_helterline) Newsgroups: comp.lang.c Subject: legal ANSI prototype? Message-ID: <31530015@hpcvia.CV.HP.COM> Date: 28 Aug 90 21:18:39 GMT Organization: Hewlett-Packard Co., Corvallis, Oregon Lines: 33 Hello netland, I have a question regarding the ANSI interpretation of a prototype declaration. My compiler accepts it, but a pc-lint program does not. I am interested in knowing which one is wrong. Here it is: extern intSomeFunction( int ); int main( void ); int main( void ) { int i = SomeFunction( 5 ); return 0; } MSC takes this just fine but my pc-lint complains that SomeFunction is called without a prototype being in scope. If I add a space in the prototype, then everybody is happy. My question is 1) is that prototype legal ANSI? 2) Am I just lucky that MSC accepts it? 3) Is my pc-lint broken because it misses it? As to the reason why it is like that, some software I purchased the following for prototypes: #define IMPORT( t ) extern t IMPORT( int )SomeFunction( int ); .... Thanks for your help. -Brian