Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!brl-adm!adm!Schauble@mit-multics.arpa From: Schauble@mit-multics.arpa Newsgroups: comp.lang.c Subject: More on Microsoft C problem Message-ID: <6375@brl-adm.ARPA> Date: Mon, 30-Mar-87 04:26:19 EST Article-I.D.: brl-adm.6375 Posted: Mon Mar 30 04:26:19 1987 Date-Received: Tue, 31-Mar-87 04:19:55 EST Sender: news@brl-adm.ARPA Lines: 58 This is a followup on my recent message about error checking in Microsoft C V4.0. The problem in that message was: Within one file I have the function declaration void bgunlink_transaction_record (bgfile, client, transaction) BGFILE *bgfile; struct tclient_rec *client; struct ttransaction_rec *transaction; { .... } The type BGFILE and the structures are correctly declared prior to this. Later in the file I have the statement bgunlink_transaction_record (&bgfile, &client_rec, rec, &transaction); Note that they don't match in number or types of arguments. When compiling with /W3 for maximum checking, the compiler SAYS NOT A WORD ABOUT THIS. On thinking about it more, this seemed even stranger. The compiler does process function declarations to get the return type. That is, the program fragment: int f(i,p) int i; char *p; {} void main() { int i; char *p, *z; z = f(p,5); } produces a warning about the assignment to z (int assigned to char *) but not about the argument mismatch. Adding the line int f(char *, int *); causes a warning about the assignment, but again not about the argument mismatch. I believe that this is a violation of the proposed ANSI standard in that this redefinition of f is not allowed. Would someone who has a copy of the standard please check. And finally, most curiously of all, deleting the function definition and leaving only the prototype now produces the warning about argument mismatch. Note that the arguments were apparantly not checked even when the prototype was present if the function was present. Having the function itself in the same compilation should certainly not suppress argument checking. There's something wrong here. Paul .