This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: Unfamiliar GCC error message [was Re: newbie]


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


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