Messages in this thread | | | Date | Mon, 2 Sep 2013 22:51:00 +0200 | Subject | Re: [PATCH] checkpatch: Make extern in .h prototypes quieter. | From | Geert Uytterhoeven <> |
| |
On Mon, Sep 2, 2013 at 6:21 PM, Joe Perches <joe@perches.com> wrote: > The use of extern in .h files is a bit contentious. > > Make it emitted only when --strict is used on the > command-line.
IIRC, the original intention was to always use "extern" in external function or data declarations, and then complain if any "extern" keyword was found in *.c files. Always using the "extern" keyword makes it easier to flag those.
> - if (WARN("AVOID_EXTERNS", > - "extern prototypes should be avoided in .h files\n" . $herecurr) && > + if (CHK("AVOID_EXTERNS", > + "extern prototypes should be avoided in .h files\n" . $herecurr) &&
I know it's not the subject of this patch, but shouldn't "extern prototypes" be "extern keywords"?
> $fix) { > $fixed[$linenr - 1] =~ s/(.*)\bextern\s+(.*)/$1$2/; > }
Gr{oetje,eeting}s,
Geert
-- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
| |