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

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

From
PRPavel Roskin <proski@gnu.org>
Date
Jul 11, 2006, 05:17 UTC
Message-ID
<1152595047.29932.9.camel@dv>
In-Reply-To
<20060710114117.GA62514@dspnet.fr.eu.org>
Hello!
On Mon, 2006-07-10 at 13:41 +0200, Olivier Galibert wrote:
> Supporting old, not-standard-anymore compilers has a cost in
> maintainability, by precluding the use of better constructs (//
> comments, declarations near initialisation, struct initializers...).
> Additionally, it gets harder and harder to have people test for them.

Sorry for one more addition to this thread. I just want to clear some misunderstanding. The whole point of fixing the comments is to make is easier to test for other compatibility issues using gcc.

For gcc to report post-c89 features, "-pedantic -std=c89" should be supplied. This option makes gcc report the c99 comments as errors and other c99 features as warnings. The errors would stand in the way of finding the warnings.

I'm not saying all non-c89 constructs should be fixed, but if we get a report that some feature is not working with some compiler, we could compile git with "-pedantic -std=c89", find corresponding warnings and fix them. The comments would stand in the way for somebody using gcc.

-- 
Regards,
Pavel Roskin
Previous: Olivier Galibert
Message 14 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.