Subject: Re: Serial code in kernel
To: Julian Bean <jules@mailbox.co.uk>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 02/20/1996 15:17:50
> 
> 
> Their appears to be a small problem with the function kgdb_put(?) in
> mac68k/dev/ser.c at about line 1887.
> 
> The 'register int c' definition shadows a parameter 'c'.  Staring at the
> code for a couple of minutes brought me to the conclusion that this code
> had been lifted from kgdv_get, and the declaration of c (only c, not rr0)
> should be commented out, which I did, and it now compiles. (I haven't tried
> booting it yet - it is compiling other files).

Strange. I have been compiling kernels for quite a while, and not run
into this problem. I haven't ever gotten warnings, much less errors
about it.

Looking at the code, you might be correct. 'c' is the parameter which
should be printed. The question is what the compiler thinks of a parameter
and a register variable having the same name. If it double-allocates,
then there is a problem. I'm not sure what else it might do. Maybe decide
that 'c' is now a register value?

Removing 'c' from the register int declaration is a safe thing to do.
Especially as I haven't tested kernel debugging.

Take care,

Bill