Re: [PATCH 2/3] stripspace: Implement --count-lines option

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

 



On 2015-10-15 at 18:52:54 +0200, Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> wrote:
> Tobias Klauser <tklauser@xxxxxxxxxx> writes:
> > +static const char * const usage_msg[] = {
> 
> Stick the * to usage_msg please.

Just noticed while looking at how other sub-commands define this, the vast
majority use "const char * const" and not "const char const *".

Also it would change the meaning. The following wouldn't produce a
compiler warning:

	static const char const *usage_msg[] = { ... };
	...
	usage_msg[0] = "Foobar"

while

	static const char * const usage_msg[] = { ... };
	...
	usage_msg[0] = "Foobar"

would produce one:

	builtin/stripspace.c:36:2: error: assignment of read-only location ‘usage_msg[0]’

Even though I don't expect anyone to modify usage_msg at runtime I think
it'd be better to stick with the current version.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]