[PATCH 2/2] default_options: Update the comments
Michael Witten
mfwitten at gmail.com
Tue Jul 18 04:54:13 AWST 2017
On Sat, 15 Jul 2017 20:46:02 -0000, Michael Witten wrote:
> Now the comments reflect the way the code works; no code
> has been changed.
>
> In the process of updating the comments, they have also been
> copy edited; notably, old-style C comments (/**/) have been
> replaced with new-style, one-line C++ comments (//).
>
> For the record, `packet.c' is another file that has already
> been using the new-style C++ comments, so there shouldn't
> be an existing issue with old compilers.
Alas, I stumbled across this commit:
commit de1deaf0bde9c0e67932420117caeb390f8ead98
Author: Matt Johnston <matt at ucc.asn.au>
Date: Thu Nov 14 22:03:30 2013 +0800
use oldstyle comments
Is there any particular reason why you'd still insist on using
them?
Personally, I was motivated by 2 reasons to switch these comments
to the new-style:
* Practical
While editing the comments, I had inadvertantly deleted one
of the comment closers (`*/'). The results were that gcc
emitted some very confusing errors; why not just avoid
this whole issue by using comments that are guaranteed to
end at a newline?
* Aesthetic
I find the old-style comments ugly; the asterisk is a bit
jarring. Also, free-flowing prose looks funny, so comments
that are composed of multiple lines tend to be written so
that each line is prefixed with an asterisk, which is just
as noisy as new-style comments, anyway.
Again, I'd note that existing code (`packet.c') has been using
the new-style comments since early 2015:
$ git blame -L335,337 packet.c
57946393 (Matt Johnston 2015-03-01 00:57:21 +0800 335) //ses.payload = buf_new(len);
57946393 (Matt Johnston 2015-03-01 00:57:21 +0800 336) //memcpy(ses.payload->data, buf_getptr(ses.readbuf, len), len);
57946393 (Matt Johnston 2015-03-01 00:57:21 +0800 337) //buf_incrlen(ses.payload, len);
Sincerely,
Michael Witten
More information about the Dropbear
mailing list