Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

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

From: Andy Parkins <hidden>
Date: 2016-06-15 22:43:04

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@gmail.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help