git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
APAndy Parkins <andyparkins@gmail.com>
Date
Apr 15, 2007, 20:06 UTC
Message-ID
<200704152106.51082.andyparkins@gmail.com>
In-Reply-To
<20070415155110.365070d8@gnut>
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
Previous: Luiz Fernando N. CapitulinoNext: Junio C Hamano
Message 2 of 4 in “ident.c: Use const qualifier when possible”
  1. 01/02 ident.c: Use const qualifier when possibleLuiz Fernando N. Capitulino, Apr 15, 2007
  2. Andy ParkinsApr 15, 2007
  3. Junio C HamanoApr 15, 2007
  4. Luiz Fernando N. CapitulinoApr 15, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.