Microsoft C v5.1 bug

Pete Holzmann pete at octopus.UUCP
Sat Apr 22 00:36:44 AEST 1989


This is a nasty one I found a few weeks ago. It is fixed in the next version
of MSC, I'm told:

If you #include a file containing function prototype definitions that span
more than one line, then under various wierd circumstances Codeview will
show the #included file rather than your real source code file.

Example:

protos.h contains

void proto1( long a,
	long b);

main.c contains

#include "protos.h"

(any code you like)


If you use a program like READOBJ to look at the generated object file, you'll
find that a second codeview-filename record is inserted into the .OBJ... 
depending on the code in main.c, the linker will either ignore the extra
filename, or will get confused and think that your code is in protos.h.

Pete
-- 
Peter Holzmann, Octopus Enterprises   |(if you're a techie Christian & are
19611 La Mar Ct., Cupertino, CA 95014 |interested in helping w/ the Great
UUCP: {hpda,pyramid}!octopus!pete     |Commission, email dsa-contact at octopus)
DSA office ans mach=408/996-7746;Work (SLP) voice=408/985-7400,FAX=408/985-0859



More information about the Comp.lang.c mailing list