This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: messaging
- From: Ian Lance Taylor <iant at google dot com>
- To: Arthur Schwarz <aschwarz1309 at verizon dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 22 Apr 2009 17:42:04 -0700
- Subject: Re: messaging
- References: <558592.50028.qm@web84001.mail.mud.yahoo.com>
Arthur Schwarz <aschwarz1309@verizon.net> writes:
> 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.
> 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.
I filed http://gcc.gnu.org/PR39858 and http://gcc.gnu.org/PR39859 to
track these two issues and to make suggestions for how we can improve
them. Thanks.
Ian