NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/22515 (lint cares too much about comments)



The following reply was made to PR bin/22515; it has been noted by GNATS.

From: Roland Illig <roland.illig%gmx.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/22515 (lint cares too much about comments)
Date: Sun, 28 Feb 2021 22:17:10 +0100

 C99 5.1.1.2 item 3 says:
  > The source file is decomposed into preprocessing tokens
  > and sequences of white-space characters (including comments).
  >
  > Each comment is replaced by one space character.
 
 This is the usual translation mode required by C99.  GCC's -CC option
 for preserving all comments is not mentioned there because there is no
 reason to preserve comments, except for some linters.
 
 The manual page of GNU cpp 9.3.0 says:
  > Do not discard comments, [...]
  >
  > The -CC option is generally used to support lint comments.
 
 It's debatable whether a difference in the comment should be considered
 different since that is outside the scope of Standard C.
 
 GNU cpp sees it as different, and I didn't find a compiler flag to
 suppress this kind of warnings.  Reading through libcpp/macro.c did not
 reveal any obvious way to suppress these warnings either.
 
 I described the scenario here:
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D83773#c4
 


Home | Main Index | Thread Index | Old Index