This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: how to format an error?
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Cc: Andrew Cagney <ac131313 at cygnus dot com>, gdb at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Date: Mon, 14 Jan 2002 10:37:17 +0000
- Subject: Re: how to format an error?
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
>
> On Sun, 13 Jan 2002, Andrew Cagney wrote:
>
> > Given the attached, which is the correct way of formatting an error message:
> >
> > This is an error message.
> > this is an error message.
> > This is an error message
> > this is an error message
>
> I suggest the last variant. It goes with the GNU coding standards
> except for the capitalization. But capitalization is
> language-specific (e.g., in German, all nouns are capitalized), and it
> was recently discovered in Emacs development that a 100% adherence to
> the capitalization rule you cited produces wrong results in some
> cases. Most of the messages don't need caps, so I think losing that
> is the best alternative which is simple enough to adher to.
Hmm, I'd go for the third. If the message were to appear in a GUI box, it
could well be a line of text on its own, such as
************* ERROR **************
* *
* This is an error message *
* *
**********************************
In such a context I think it would be very wrong to start this with a
lower-case letter.
However, exceptions:
strings extracted from user code shouldn't have the case changed, so
print foo
error: Foo doesn't exist
would be wrong. Though I think this should be "'foo' doesn't exist"
Given that, (and that a litteral will never appear in the first letter)
can we safely assume that we can capitalize the first letter during
printing? If so, we could mandate that all messages in the source code
should start with a lower case letter (except where other capitalization
rules apply) and then have the UI output routine capitalize the first
letter as appropriate for the output stream?
R.