This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH: fix PR 10891


Eric Botcazou wrote:
>>I also almost always add PR references when I fix optimizer bugs.  But
>>what I do is first explain (in usually pretty lengthy comments) what the
>>old code was not doing right and what the fix was, and _then_ refer to
>>the PR for further details and an example of what went wrong.
> 
> The PR is alreay supposed to be referenced in the ChangeLog entry though.

Right.

I don't necessary claim that we should set a GCC-wide policy; I
certainly don't claim that I have the authority to set such a policy,
even if we wanted to do so.

However, my personal opinion is that the comments in the code should be
sufficient to understand the code, together with whatever references
(language standards, research papers, optimization handbooks, etc.) are
cited.  One of the problems with a PR reference is that when I go to
change the code, I don't know if the PR reference still makes sense, and
if it only sort-of makes sense (because, for example, we've changed
something else referred to by the PR), now I have to decide whether to
remove the PR reference entirely, or add a comment saying "See PR X, but
disregard Comment #N, and instead, ...".  As for test cases, I prefer to
ut a small testcase into a comment rather than refer to a PR.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]