[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Own assert() -> Segmentation fault
From: |
StreamKid |
Subject: |
Re: Own assert() -> Segmentation fault |
Date: |
5 Nov 2006 10:44:19 -0800 |
User-agent: |
G2/1.0 |
Ulrich Eckhardt wrote:
> A segmentation fault occurs when you access memory you are not allowed to
> access. Typically this is caused by an invalid pointer. If you want to
> know where, use a debugger (typically gdb).
OK I 'll try this.. :)
> FYI: this macro has no meaning to standard C++, the one used to turn off
> assert() is NDEBUG.
It's an example..
> Bad: you are not allowed to define any names used by the standardlibrary.
> - You could have used a single printf().
I saw it on a book, and I was curious to compile it. It's not my code!
I know, but I don't think that's the prob.
> - If you compile this with warnings turned on, it will give you a warning
> which is the cause of your segmentation fault.
I compiled it with GCC 3.4.6 but I didn't get any warnings!!!