| delorie.com/archives/browse.cgi | search |
rpolzer AT web DOT de (Rudolf Polzer) wrote:
> But I just also tested a simple test program:
>
> void main()
> {
> char *p = 0;
> *p = 'X';
> }
>
> which compiles (with a warning about main being void)
It compiles cleanly like this:
int main(void)
{
char *p = 0;
*p = 'X';
return 0;
}
> and crashes with a
> SIGSEGV at the correct address. I see a GPF, but this is still enough
> information because of the correct line numbers.
I only see a SIGSEGV in real-mode DOS, not in Windows 95...
> And I do not think clean code can contain a line which can produce many
> errors that result in SIGSEGV but gives no hint about it.
Try stepping up the warnings you have enabled. I don't think it's
possible for gcc to flag bugs like in the above example but it might
show up some other problem with your code.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |