Re: [PATCH 01/02] ident.c: Use const qualifier when possible

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

 



On Sunday 2007, April 15, Luiz Fernando N. Capitulino wrote:

> -static const char *env_hint =
> +static const char const *env_hint =

 char c;              // c is a char
 char *p;             // p is a pointer, *p is a char
 const char c;        // c is a const char  [1]
 char const c;        // c is a const char  [1]
 const char *p;       // p is a pointer, *p is a const char [2]
 char const *p;       // p is a pointer, *p is a const char [2]
 char *const p;       // p is a const-pointer, *p is a char
 const char *const p; // p is a const-pointer, *p is a const-char

[1] Semantically identical
[2] Semantically identical

You can see then that

 const char const *env_hint

is redundant, it's simply saying twice that (*env_hint) is const.


Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@xxxxxxxxx
-
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]