On 10 October 2017 at 08:54, Jiang Biao <[email protected]> wrote: > When adding a function declaration in a .c file without extern > keywork decoration, checkpatch.pl will report *externs should be > avoided in .c files* false error. This patch fixes the bug.
I don't think this is a bug. "extern int foo(void);" and "int foo(void);" have the same effect: they declare a function prototype that can be called from outside the file. We don't want to permit that in QEMU. Either: (1) the function is for use only within this file: the declaration should be "static int foo(void);" (2) the function is for use by other files too: the declaration should be in a header file, not a .c file, so the other files can use it Do you have an example of code where this warning is a problem? thanks -- PMM
