Path: utzoo!utgpu!water!watmath!uunet!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%blanche.ics.uci.edu From: schmidt%blanche.ics.uci.edu@ORION.CF.UCI.EDU ("Douglas C. Schmidt") Newsgroups: gnu.g++.bug Subject: More permissive g++ behavior Message-ID: <8810311726.aa09601@PARIS.ICS.UCI.EDU> Date: 1 Nov 88 01:26:27 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 33 Hi, Here is another case of const perversion that g++ should probably complain about: ---------------------------------------- #include int * Foo ( const int *p ) { return ( p ); // attempt to circumvent the const qualifier } main (int, char *argv[]) { int i = atoi ( argv [ 1 ] ); const int *p = &i; *( Foo ( p ) ) = 10; cout << *p << "\n"; } ---------------------------------------- cfront 1.2.1 prints out: ---------------------------------------- CC test.C: "test.C", line 4: error: bad return value type for Foo(): const int * ( int * expected) 1 error ---------------------------------------- Doug ---------- schmidt@bonnie.ics.uci.edu (ARPA) | Quis costodiet ipsos custodes?