This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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: [COMMIT] Improve coding standard in dbxread.c


   Date: Sat, 20 Nov 2004 19:19:42 +0200
   From: "Eli Zaretskii" <eliz@gnu.org>

   > Date: Sat, 20 Nov 2004 13:39:09 +0100 (CET)
   > From: Mark Kettenis <kettenis@gnu.org>
   > 
   > Only a tiny fraction of the code, but it's a step into the right
   > direction.

   I think changes like these are wrong:

   > -    case N_STSYM:		/* Static symbol in data seg */
   > -    case N_LCSYM:		/* Static symbol in BSS seg */
   > -    case N_ROSYM:		/* Static symbol in Read-only data seg */
   > +    case N_STSYM:		/* Static symbol in data segment.  */
   > +    case N_LCSYM:		/* Static symbol in BSS segment.  */
   > +    case N_ROSYM:		/* Static symbol in read-only data segment.  */

   The text in these comments does not constitute a full sentence, and so
   adding a period at the end is not the right change.  The right way to
   fix this, IMHO, is to lower-case the first letter of the comment, like
   this:

The coding standards say:

"Also, please write complete sentences and capitalize the first word."

Now indeed it is debatable whether the comments above are complete
sentences; there's no verb in them.  But these comments feel very
sentence-like.  Anyway, I was aiming for some consistency here.

       case N_STSYM:		/* static symbol in data segment */

   There are numerous other instances of similar changes, and IMHO they
   all are wrong.  This one looks particularly incorrect after the
   change:

   > +    case N_NOMAP:		/* No map?  (Ultrix).  */

   Some of the other changes simply reformat comments to break the line
   at a different column.  Do we have a canonical column number for that,
   and if we do, what is its value?

I always consider the GNU indentation style provided by emacs to be an
implementation of the canonical formatting style.  The canonical
column therefore would be 32.  But again, my intent here was
consistency here.  The useage was very inconsistent makeing the code
difficult to read.

Mark


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