This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Unfamiliar GCC error message [was Re: newbie]
- From: Zane Dodson <zdodson at zdodson dot com>
- To: Guy Lepine <glepine at mediatrix dot com>
- Cc: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 8 Jul 2002 23:30:13 -0500
- Subject: Re: Unfamiliar GCC error message [was Re: newbie]
- References: <F1BED55F35F4D3118C0F00E0295CFF4D0169C5B9@mail.mediatrix.com>
On Mon, Jul 08, 2002 at 03:17:18PM -0400, Guy Lepine wrote:
| Good day,
| I am fairly new with gcc and some compilation errors I get do not
| make much sense to me. I was wondering if there was a reference in which I
| could find more detailed explanations about the errors I get. E.g. the
| following one is not obvious to me:
|
| "passing const CClass as 'this' argument of 'CClass::Method(...)' discards
| qualifiers"
Although I don't know of any GCC-specific documentation on the
errors, the terminology used in error messages (such as the one you
show above) come from the C++ standard.
The ultimate reference is the ISO/IEC 14882:1998 which defines the
language. You can find most of the terminology there (although
sometimes it's rather buried). It is available for $18.00 from
www.ansi.org (select `Standards Info' and search for 14882).
Stroustrup's book also uses much of the jargon and is an easier
read.
With regard to your specific error message above, it sounds as if
CClass::Method() has been declared non-const and you are attempting
to invoke it with a const instance of CClass. The relevant section
in Stroustrup's book on this topic is `Constant Member Functions',
section 10.2.6. In the ISO standard, this information is in section
9.3.2, `The this pointer'.
Best regards,
--
Zane Dodson
zdodson@zdodson.com