patch: morpho ms1-elf support
Mark Mitchell
mark@codesourcery.com
Tue Jul 5 23:46:00 GMT 2005
DJ Delorie wrote:
>>You probably agree, so this is probably not what you mean.
>
>
> Right, I was mostly concerned about codifying "all functions must have
> comments" when what we want is "all functions that should have
> comments, have comments". IMHO the former is detrimental to
> maintenance.
I think that's a hard argument to make. I know people make it, and I'm
familiar with the many variations, but the cases where documentation is
actively harmful are pretty few and far between. This argument is
certainly made more often by people who have to write documentation than
people who are reading it.
> I was thinking of stuff like this (which I do a lot):
>
> #define FUNCTION_ARG_REGNO_P(r) m32c_function_arg_regno_p (r)
Even there:
/* Return true if R is a hard register number in which arguments are
sometimes passed. */
would be nice. (And, pedantically, I think "r" should be named "REGNO",
both for consistency with the internals documents and to clearly
indicate that this is a register number, not an rtx.)
Sure, I can go back to the internals documentation to get this, but I'm
looking at the code in your file, and I can't remember everything at once.
My high-level thoughts are:
* I concede that documentation can sometimes be harmful, either by being
wrong, or by being obfuscatory, but I think that happens much less often
than the case where missing documentation makes things hard. Therefore,
I'd far rather we err by having too much documentation than too little.
* Compared to the rest of developing a new port, the amount of effort
required for adding these comments is small.
* This is not a really big deal to me, so if it is a really big deal to
you, I wouldn't want to spend a lot of time (for either of us) in trying
to change your mind.
* If a reviewer chooses to require such documentation, it would be
better to provide it than argue about it; both alternatives will take
about the same amount of time, and I don't think a reviewer is obligated
to continue reviewing a patch if the submitter doesn't want to do what's
asked.
For the case in question, Joseph is not a global write person, so his
comments are advisory. Still, I think Aldy would be well-served to deal
with the comments proactively, as some reviewers (me, for example) would
probably require them.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304
More information about the Gcc-patches
mailing list