LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   g++ caused a SEGV! Sweet! (http://www.linuxquestions.org/questions/programming-9/g-caused-a-segv-sweet-196882/)

The_Nerd 06-23-2004 02:44 PM

g++ caused a SEGV! Sweet!
 
Check this out:
(writing this from memory... so it my be incomplete)

Code:

template <class T>
myotherclass<T> *myclass<T>::operator[](int i)
{
    myotherclass<T> *Temp=this->Val[i];
    return (Temp==NULL)?this->Val.pData:Temp->pData;
}

This code (it was VERY similar if not this) caused g++ to segmentation fualt! HAha!

I bet you guys never coded so poorly that gcc caused a SEGV! SWEET!

:D :cool:

Thats what happens when you are learning I guess. :newbie:

infamous41md 06-23-2004 03:06 PM

you should reproduce it exactly and contact g++ developers.

The_Nerd 06-23-2004 07:39 PM

I was going too, but then I though that I didn't have the newest version of gcc, and that I didn't really want to install an update at this time. Anyhow, I probably will sometime.


All times are GMT -5. The time now is 05:00 PM.