Eric Blake <[EMAIL PROTECTED]> wrote:
> Jim Meyering <jim <at> meyering.net> writes:
>> However, rather than changing sc_const_long_option to avoid
>> sc_redundant_const triggering on it's regexp, I've chosen to use
>> a stricter regexp in the new rule so we don't have to twist the
>> other rule:
>>
>>   grep -E '\bconst\b[[:space:][:alnum:]]{2,}\bconst\b' ...
>
> Nice.  But that lets "static const const int" fall through the cracks.  Why 
> not
> use + instead of {2,}?

To avoid this false-positive:

    #define const const

>From maint.mk:

  # Warn about "c0nst struct Foo const foo[]",
  # but not about "char const *const foo" or "#define const const".

Also, I assumed that gcc would still warn about such
an obviously duplicate "const".  I'm pretty sure that
gcc used to detect those.  Perhaps that it doesn't
is an accidental regression, or just a new -Woption away.


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to