Thread: Compiler seg fault

  1. #16
    Registered User
    Join Date
    Jun 2004
    A sugestion... or not since your gcc is a bit old.. send your source to gcc bugzilla. Let's see if that bug has already, or not, been corrected.

  2. #17
    Registered User
    Join Date
    May 2005
    I found that the seg fault occurs because of the function call, not because of the assignment. I changed it a bit so that:
    double buffer = Score(actual, data);
    This causes the compiler to crash still.

  3. #18
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    I find these statements at odds.
    Quote Originally Posted by Buckshot
    actual is a struct passed by reference to the function, data is also a struct.
    I've checked to make sure that score is a member, and it is.
    The Score function's declaration looks like:
    double Score(AEE addeff, datavar data);
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  4. #19
    Registered User
    Join Date
    May 2005
    Whoa, thanks. Its supposed to be passed by reference. Missed the '&'.
    However, I'm still getting the seg fault.
    The declaration was supposed to be:
    double Score(AEE &addeff, datavar &data);
    Last edited by Buckshot; 06-16-2005 at 09:40 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting a seg fault
    By ammochck21 in forum C Programming
    Replies: 11
    Last Post: 01-23-2009, 04:27 AM
  2. next_permutation seg fault
    By zxcv in forum C++ Programming
    Replies: 9
    Last Post: 12-14-2008, 06:40 AM
  3. seg fault
    By hka26 in forum C++ Programming
    Replies: 1
    Last Post: 10-08-2007, 01:38 AM
  4. Found a seg fault, but can't explain why i get it
    By misplaced in forum C++ Programming
    Replies: 11
    Last Post: 08-29-2005, 02:58 AM
  5. seg fault with strcmp
    By samps005 in forum C Programming
    Replies: 2
    Last Post: 05-04-2003, 04:32 PM
Website Security Test