Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!auvbarn From: auvbarn@auvc5.tamu.edu (David Barnett) Newsgroups: comp.lang.c Subject: parameter names in prototypes Message-ID: Date: 13 Dec 90 00:53:42 GMT Sender: usenet@helios.TAMU.EDU Distribution: comp Organization: Texas A&M University, College Station, TX Lines: 23 Is the following prototype legal in ANSI C? int foo(int a, int ); Saber-C 3.0 rejects this as an error: "The function parameter list has an illegal format". On the other hand, gcc 1.37 compiles it without so much as a warning, even when using -Wall -ansi -pedantic. I don't see anything in K&R2 that explicitly allows or prohibits this. Page 26 says "parameter names are optional in a function prototype", but in each of the examples, either all of the parameters have names or none do. What about the half-and-half case above? (I'm asking because prototypes of this form occur in a vendor-supplied .h file, and I need to know whether to complain to that vendor or to Saber-C.) -- David Barnett dbarnett@cs.tamu.edu -- David Barnett auvbarn@auvsun1.tamu.edu