Re: [PATCH] checkpatch: Make extern in .h prototypes quieter.

From: Geert Uytterhoeven
Date: Mon Sep 02 2013 - 16:51:04 EST


On Mon, Sep 2, 2013 at 6:21 PM, Joe Perches <joe@xxxxxxxxxxx> 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@xxxxxxxxxxxxxx

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/