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

Re: [PATCH] Avoid C++ comments, use C comments instead

From
Junio C Hamano <junkio@cox.net>
Date
Jul 10, 2006, 07:46 UTC
Message-ID
<7vzmfhdhrf.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060710065751.22902.43316.stgit@dv.roinet.com>
Pavel Roskin <proski@gnu.org> writes:
Show 8 quoted lines
> From: Pavel Roskin <proski@gnu.org>
>
> This doesn't make the code uglier or harder to read, yet it makes the
> code more portable.  This also simplifies checking for other potential
> incompatibilities.  "gcc -std=c89 -pedantic" can flag many incompatible
> constructs as warnings, but C++ comments will cause it to emit an error.
>
> Signed-off-by: Pavel Roskin <proski@gnu.org>

The title should probably read "avoid C99 comments", but coming from the previous century, I tend to agree with this.

The struct/array initializer stuff by Shawn makes them harder to read (for structs, it moves initialization to actual code) and more error prone (for arrays, now the initializers need to be carefully kept ordered), but we do not have too many of them in the code, so I do not think it is a not much of a practical problem. It is sad that some people stay behind and we need to cater to them, though.

Previous: Pavel RoskinNext: Olivier Galibert
Message 2 of 14 in “Avoid C++ comments, use C comments instead”
  1. Avoid C++ comments, use C comments insteadPavel Roskin, Jul 10, 2006
  2. Junio C HamanoJul 10, 2006
  3. Olivier GalibertJul 10, 2006
  4. Johannes SchindelinJul 10, 2006
  5. Olivier GalibertJul 10, 2006
  6. Paul SericeJul 10, 2006
  7. Olivier GalibertJul 10, 2006
  8. Johannes SchindelinJul 10, 2006
  9. Yakov LernerJul 10, 2006
  10. Olivier GalibertJul 10, 2006
  11. Shawn PearceJul 11, 2006
  12. Junio C HamanoJul 11, 2006
  13. Olivier GalibertJul 10, 2006
  14. Pavel RoskinJul 11, 2006

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.