Article View: gnu.g++.bug
Article #1711Re: Error compiling etc in libg++ 1.34 with gcc 1.34 on Sun4/260
From: Doug Schmidt
Date: Fri, 10 Mar 1989 22:38
Date: Fri, 10 Mar 1989 22:38
67 lines
3025 bytes
3025 bytes
In article <4347@psuvax1.cs.psu.edu> ehrlich@shire.cs.psu.edu () writes:
++ When I tried to compile etc in libg++ 1.34 with gcc 1.34 on a Sun
++ 4/260 under SunOS 4.0 the 'tests' make target fails with the following
++ error:
++ Patricia.h:66: warning: class Trie_Node only defines private constructors
++ In function int main (int, char **):
++ Patmain.cc:17: parse error before `return'
++ Patmain.cc:28: parse error before `return'
This resulted from an overzealous emacs global replace, I believe!
(This brings up a useful C++ tip, BTW. When declaring class variables
with constructors and destructors locally in the main function of a
program it is usually best to pass a status value back to the shell
using `return' rather than `exit.' Calling exit will result in any
local destructors not being envoked, since it is a function that never
returns. When C++ has proper exception handling this problem should
go away (but don't hold your breath ;-)).
The fix is included below. Thanks for reporting this, and please
remember to send future libg++ bug reports to the gnu.g++.lib.bug
newsgroup.
Doug
----------------------------------------
*** Patmain.cc.~1~ Thu Mar 9 03:53:48 1989
--- Patmain.cc Fri Mar 10 14:30:00 1989
***************
*** 14,20 ****
}
else {
if ( ! freopen ( argv [ 1 ], "r", stdin ) ) {
! perror ( argv [ 0 ] ), return;
}
Patricia_Trie Trie;
char Key [ Max_Key_Len ];
--- 14,20 ----
}
else {
if ( ! freopen ( argv [ 1 ], "r", stdin ) ) {
! perror ( argv [ 0 ] ); return ( 1 );
}
Patricia_Trie Trie;
char Key [ Max_Key_Len ];
***************
*** 25,31 ****
fclose ( stdin );
if ( ! freopen ( argv [ 2 ], "r", stdin ) ) {
! perror ( argv [ 0 ] ), return;
}
start_timer ();
--- 25,31 ----
fclose ( stdin );
if ( ! freopen ( argv [ 2 ], "r", stdin ) ) {
! perror ( argv [ 0 ] ); return ( 1 );
}
start_timer ();
----------------------------------------
--
schmidt@ics.uci.edu (ARPA) | Per me si va nella citta' dolente.
office: (714) 856-4043 | Per me si va nell'eterno dolore.
| Per me si va tra la perduta gente.
| Lasciate ogni speranza o voi ch'entrate.
Technical Details
Message-ID:
<8972@paris.ics.uci.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!bloom-beacon!bionet!rutgers!ucla-cs!oberon!orion.cf.uci.edu!uci-ics!siam.ics.uci.edu!schmidtReferences:
<4347@psuvax1.cs.psu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!bloom-beacon!bionet!rutgers!ucla-cs!oberon!orion.cf.uci.edu!uci-ics!siam.ics.uci.edu!schmidt From: schmidt@siam.ics.uci.edu (Doug Schmidt) Newsgroups: gnu.g++.bug Subject: Re: Error compiling etc in libg++ 1.34 with gcc 1.34 on Sun4/260 Message-ID: <8972@paris.ics.uci.edu> Date: 10 Mar 89 22:38:46 GMT References: <4347@psuvax1.cs.psu.edu> Sender: news@paris.ics.uci.edu Reply-To: Doug Schmidt <schmidt@siam.ics.uci.edu> Followup-To: gnu.g++.lib.bug Distribution: na Organization: University of California at Irvine: ICS Dept. Lines: 67