C Compiler Bug (yes, another one)

Knudsen knudsen at ihlpl.ATT.COM
Fri Oct 14 05:27:38 AEST 1988


YACCB == Yet Another Microware OS9/6809 'C' Compiler Bug (just what we
needed).

This one is strange, and probably occurs only when the compiler is
overloaded by a big source file.

After a *very* long main() function definition,
and a couple of static arrays,
I had several more very short function bodies.
The second one looked like

int	barmice(x)
  int	x;
{
	int i;
	....couple lines of code ....
}

and the compiler tagged the "int x" as "redeclaration of x."
Or mayube "redefinition."

Now that's quite a trick, since argument variable declarations
override any other usage of that same name.
[I'd already called barmice(mx), where mx was also int;
I hear some fancy compilers will pre-infer argument types from calls,
something I've only seen LINT do.]

Changing  x's name to something unique didn't help.
Swapping this function body with the following one got rid of
the error.  I don't consider that much of a "fix."

My belief is that some table in the compiler got full.
Since the 6809 compiler phases don't bother to check for I/O
errors (like disk full), I suspect they didn't catch this table-full
error and either messed up a table entry or expanded one table
to tromp on some other data, so all bets were off.

Guess we'll just have to keep our function bodies less than a few pages
each, even for main().  (Flames about programming style to /NIL).
I like the Microware C compiler, but I sure wish they'd
do better error checking, at least in Level II where you can afford
the extra memory.
-- 
Mike Knudsen  Bell Labs(AT&T)   att!ihlpl!knudsen
"Lawyers are like handguns and nuclear bombs.  Nobody likes them,
but the other guy's got one, so I better get one too."



More information about the Comp.lang.c mailing list