public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: aschwarz1309@verizon.net
To: Kai Henningsen <kai.extern@googlemail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: messaging
Date: Tue, 14 Apr 2009 16:58:00 -0000	[thread overview]
Message-ID: <997077.50682.qm@web84003.mail.mud.yahoo.com> (raw)


Thanks Kai. I do have what I hope is a more specific subjective reason for saying that I think the existing diagnostics should be changed. Fundamentally, what is provided in the messaging is not an indication of what is wrong, but an indication of what is required to repair the fault. My objections then become:
1: As an old man full of wisdom, most developers can't distinguish a
   'primary-expression' from a washing machine. Further, to determine
   what correction might be needed most users would have to research
   the C++ standard (or other standardized document supported by the
   g++ development community) to find out exactly what constitutes a
   'primary-expression'. 
2: It puts an obligation on the g++ development community to ensure
   that the messaging is consistent with documentation and that if the 
   term 'primary-expression' changes then g++ will change the messaging
   to conform to the new term. 
3: The cause of the error is more specific than it's solution. The cause
   of the fault is the user (in this case me) provided something that
   was wrong. It wasn't the lack of a 'primary-expression' but the
   existence of the illegal constructs. My conjecture is that if the
   message says "you did this wrong" then the user would have an easy
   time of finding a fix.

I don't argue with the details of my wording. My intent is not to show that I am a better wordsmith but that the existing diagnostic messages are not specific enough. From Item 1: above, in order for the average user to fix the error the user must research the terms used, then compare the syntax given with the actual fault, and then fix the error. If the message say "this is the fault", the research goes the way of the woolly-mammoth.

The paradigm is that the message should provide the minimum amount of information required to identify the syntax/semantics which caused the failure.

art

--- On Mon, 4/13/09, Kai Henningsen <kai.extern@googlemail.com> wrote:

> From: Kai Henningsen <kai.extern@googlemail.com>
> Subject: Re: messaging
> To: "Arthur Schwarz" <aschwarz1309@verizon.net>
> Cc: gcc@gcc.gnu.org
> Date: Monday, April 13, 2009, 11:12 PM
> Arthur Schwarz schrieb:
> > In the following code fragment:
> > 
> > # include <ios>
> > # include <fstream>
> > # include <istream>
> > 
> > using namespace std;
> > void CommandLine(int argc, char** argv);
> > int main(int argc, char** argv) {
> >    CommandLine(argc, argv[]);
> >    ifstream x.open(argv[1], ios:in);
> >    ofstream y.open(argv[1], ios::in);
> >       return 0;
> > };
> > 
> > g++-4 messaging is:
> >>> g++-4 x.cpp
> > x.cpp: In function 'int main(int, char**)':
> > x.cpp:8: error: expected primary-expression before ']'
> token
> > x.cpp:10: error: expected primary-expression before
> ':' token
> > 
> > A recommendation and reason for change is:
> > 1: x.cpp:8 error: illegal to pass an array without
> subscript value as an    argument
> >    The given message is accurate but
> non-expressive of the reason
> >    for failure.
> 
> Actually, in this case I'd say that the original message is
> perfectly fine, and your suggestion is rather confusing.
> However, what one could say here is something like "[] is
> only allowed in declarations".
> 
> 
> > 3: cpp:10 error: illegal scope resolution operator
> ':'
> >    From memory, there are three uses of ':'
> in C++
> >    ':'   label terminator,
> <label>:
> >    ':'   case in a switch
> statement, case <value>:
> >    ':'   scope resolution
> operator, "::"
> >    The given diagnostic message is
> deceptive. 
> 
> Could perhaps say "':' is not a scope resolution operator",
> unless someone comes up with a use case where it is ...
>

             reply	other threads:[~2009-04-14 16:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 16:58 aschwarz1309 [this message]
2009-04-14 19:34 ` messaging Kai Henningsen
2009-04-15  3:21   ` messaging Jonathan Wakely
2009-04-14 22:21 ` messaging James Dennett
  -- strict thread matches above, loose matches on Subject: below --
2009-04-15  6:51 messaging Arthur Schwarz
2009-04-15  6:51 ` messaging Manuel López-Ibáñez
2009-04-13 22:30 messaging Arthur Schwarz
2009-04-14 13:02 ` messaging Kai Henningsen
2009-04-23  5:50 ` messaging Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=997077.50682.qm@web84003.mail.mud.yahoo.com \
    --to=aschwarz1309@verizon.net \
    --cc=gcc@gcc.gnu.org \
    --cc=kai.extern@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).