Re: [PATCH] strbuf: use designated initializers in STRBUF_INIT

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

 



On Fri, Jul 14 2017, Junio C. Hamano jotted:

> Junio C Hamano <gitster@xxxxxxxxx> writes:
>
>  - This may be showing I am not just old fashioned but also am
>    ignorant, but I do not see much point in using the following in
>    our codebase (iow, I am not aware of places in the existing code
>    that they can be improved by employing these features):
>
>    . // comments

[Feel free to ignore this E-Mail and my fascination with C syntax
trivia]

I wouldn't advocate switching to them on this basis, but since you asked
for cases where things could be improved with // comments:

The other day I submitted a patch that included this line in a comment:

    +        * "t/**.sh" and then conclude that there's a directory "t",

Which you fixed up to, before integrating it:

    +        * "t/" + "**.sh" and then conclude that there's a directory "t",

That was only necessary due to limitations in one of two comment
syntaxes modern C supports.

Well, it wasn't *necessary*, but a compiler warned about the /* there as
a possibly confusing construct, and any compiler would have ended the
comment right there + errored out if it contained "t/**/*.sh".



[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