This is the mail archive of the
mailing list for the GCC project.
Re: patch: morpho ms1-elf support
My reply to DJ's m32c port submittal seems to have burst a few of his
blood vessels. ;) Sorry DJ, I wasn't trying to be annoying. I just
thought that "some sort of comment is better than no comment". If I'd
known you felt so strongly about this, I'd probably have kept quiet.
Anyway, I just wanted to AOL Ian's message here. This was exactly
the sort of thing I meant.
Ian Lance Taylor <email@example.com> writes:
> I think that if you give some people the latitude to not write
> comments, then they won't write comments, even when they really ought
> to. So my opinion is that we should keep requiring comments, while
> trying to be sensible about it rather than pedantic.
>> #define FUNCTION_ARG_REGNO_P(r) m32c_function_arg_regno_p (r)
> As I understand it, this doesn't requires a comment under our existing
> rules anyhow.
That was my understanding too. The documentation of standard macros
belongs in tm.texi, and if you group standard function-forwarding macros
like this together, are any comments needed? Shouldn't the details be
above m32c_function_arg_regno_p instead?
>> m32c_extra_memory_constraint (char c, const char *str ATTRIBUTE_UNUSED)
>> return c == 'S';
> Speaking personally, I would normally add a comment like "Implements
> EXTRA_MEMORY_CONSTRAINT." If nothing else, that makes it easy to find
> using grep.
That's exactly what I had in mind too.
Like Richard Kenner says, I think the rule that every function must have
a comment describing its arguments and return values really is a good
thing. But if the function is implementing a standard, documented
interface, just name-checking that interface provides these details
in one line.