Mail Archives: djgpp/2000/02/23/14:23:10
Sahab Yazdani <beyonder69 AT geocities DOT com> wrote:
[...]
> writer->DrawString( x,y, "string", colour );
> it crashes on other computers (but not my own), yet when I use it like
> this:
> char *string;
/* I hope you filled 'string' with some useful value, between these,
* right? */
> writer->DrawString( x,y, string, colour );
> it works fine... now can anybody tell me whats going on??
It's a bit hard to tell, as you didn't show us your 'DrawString'
routine in source code. But here is a guess: you may be writing to the
string passed in, inside DrawString. But string constants like the
"string" in the above example are not writable, so you should get a
segmentation fault, from this. Why you do not get this erorr, on your
own machine, I do not know. Did you check out for possible differences
between your machine, and those it crashes on (operating system, DOS
box or true DOS mode?, if raw DOS, what's the DPMI server?)?
At full warning level, I think gcc would have warned you about
dismissing a 'const' qualifier when you pass "string" to your routine.
If this doesn't help, please provide more details:
1) a symified crash dump
2) the smallest compilable source code to reproduce the error
3) the full compiler command line you used
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -