Mail Archives: djgpp/2001/01/28/09:36:27
Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk> schrieb Folgendes:
> 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;
> }
I know, I posted my code because it is shorter, but said clearly that I
know about the warning and do not want to read about this.
> > 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...
I use WinME. (still the latest RC and not the real final version, I got
the RC original CD-ROM and do not want to buy the real WinME)
> > 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.
Perhaps it can flag this one when optimizing.
--
Nuper erat medicus, nunc est vispillo, Diaulus:
Quod vispillo facit, fecerat et medicus.
- Raw text -