bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: recent const churn


From: Jim Meyering
Subject: Re: recent const churn
Date: Tue, 17 Jun 2008 16:55:11 +0200

Eric Blake <address@hidden> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]