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

From: Andy Parkins <[email-masked]>
Date: Sun, 15 Apr 2007 21:06:49 +0100

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