On 7/4/22 10:58, Luca Fancellu wrote:
I am not 100% sure about this patch.
I think show_stack() should be declared the same way as show_registers().
So either both of them will be declared with external linkage or both of them
will be declared with internal linkage.
I think that those 2 should be declared with external linkage with a comment
explaining why they are. For me those are useful when developing or debugging
and I sometime call those to force dumping the status.
So I would vote to keep the external linkage.
I decided to declare both of them static because they are referenced only in
traps.c but I could have, also, add the declaration of show_stack() in
asm/processor.h header instead. Rule 8.7 is advisory.
As said I would vote for external linkage here but would be nice to have other
developers view on this.
In addition to this, if we don’t want to provide a justification for those,
since they seems to me
code related to debugging they can be removed from “production” code in some
way.
Rule 8.7 is advisory, so I think that formal justification of deviations
is not necessary.
Cheers
Bertrand
--
Xenia