Re: [PATCH 0/11] renaming argv_array

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

 



On Tue, Aug 11, 2020 at 06:08:22PM +0200, René Scharfe wrote:
> Am 28.07.20 um 22:21 schrieb Jeff King:
> > The argv_array data type has turned out to be useful in our code base,
> > but the name isn't very good. From patch 2 of this series:
> >
> >   The name "argv-array" isn't very good, because it describes what the
> >   data type can be used for (program argument arrays), not what it
> >   actually is (a dynamically-growing string array that maintains a
> >   NULL-terminator invariant). This leads to people being hesitant to use
> >   it for other cases where it would actually be a good fit. The existing
> >   name is also clunky to use. It's overly long, and the name often leads
> >   to saying things like "argv.argv" (i.e., the field names overlap with
> >   variable names, since they're describing the use, not the type). Let's
> >   give it a more neutral name.
> >
> > This has bugged me for a while, so I decided to finally fix it. It
> > wasn't _too_ painful, though I'm sure there will be a little fallout
> > with topics in flight.
>
> Just as this landed in master now, https://lobste.rs/ decided to link to
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2493.pdf, which is a
> paper about reserved identifiers in C.  It contains a nice overview.
>
> Anyway, 7.31 of C11 says: "All external names described below are
> reserved no matter what headers are included by the program."  And
> 7.31.13 goes on: "Function names that begin with str, mem, or wcs and a
> lowercase letter may be added to the declarations in the <string.h>
> header."  So the names of the strvec functions are reserved.
>
> Also how about using Coccinelle and patience to reduce the impact of
> such a change next time?  I.e. adding the new thing, providing a
> semantic patch for converting old code, waiting a reasonable amount of
> time after the last conversion was necessary and then removing the
> old thing.

I don't think that this is a bad idea at all, but I'm also totally fine
with the approach that Peff took here. (Bear in mind that I'm saying
this as someone who didn't have any topics that used argv_array, and so
didn't have to do any conversion effort ;-)).

I worry a little bit about providing too long a grace period where we
have to worry about not introducing new uses of argv_array, and still
having to deal with some (perhaps less) fall-out later down the line.

For this change, I think it was perfectly fine to just rip the bandaid
off.

> René

Thanks,
Taylor



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux