Re: [PATCH] headers_check.pl: disallow extern's

Arnd Bergmann
2008-12-31T16:58:22Z

On Saturday 27 December 2008, Mike Frysinger wrote:
> +
> +sub check_prototypes
> +{
> +       if ($line =~ m/^\s*extern\b/) {
> +               printf STDERR "$filename:$lineno: extern's make no sense in userspace\n";
> +               $ret = 1;
> +       }
> +}

Unfortunately, this way you can only detect prototypes with an explicit
'extern' in them, not the equivalent form with an implicit extern.

Not sure if we can detect the other form reliably from perl.