Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UXC.CSO.UIUC.EDU!mtfsun!allen From: mtfsun!allen@UXC.CSO.UIUC.EDU (Michael Allen) Newsgroups: gnu.g++.bug Subject: g++ version 1.35.0, sunos 4.0.3 on sun 4/260 Message-ID: <8907312149.AA01272@mtfsun.> Date: 31 Jul 89 21:49:13 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: allen@fnnet.fnal.gov Distribution: gnu Organization: GNUs Not Usenet Lines: 39 I wanted to overload the builtin hex function to take an unsigned argument, so I tried: ====================Cut Here for file tryhex.cc=========================== #include char* hex(unsigned ux, int width =0) { if ( long(ux) < 0 ) { if ( width ) return form(form("%d%%x",width),ux); else return form("%x",ux); } else return hex(long(ux)); } int main() { unsigned long z = 0xffffffff; // its signed value is -1 cout << "z = " << z << " decimal, " << hex(z) << " hex.\n"; return 0; } ====================Cut Here=========================== Results of 'g++ -c tryhex.cc' In function int main (): tryhex.cc:20: Segmentation violation g++: Program cc1plus got fatal signal 11. I also tried this with the -O flag and the -g flag, each gave the same error. Thanks, Michael Allen