www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/23/14:23:10

From: Hans-Bernhard Broeker <broeker AT acp3bf DOT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: something wierd is going on...
Date: 23 Feb 2000 09:40:41 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 36
Message-ID: <8909up$mbp$1@nets3.rz.RWTH-Aachen.DE>
References: <38B3192A DOT F17E3572 AT geocities DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 951298841 22905 137.226.32.75 (23 Feb 2000 09:40:41 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 23 Feb 2000 09:40:41 GMT
User-Agent: tin/1.4-19991113 ("No Labels") (UNIX) (Linux/2.0.0 (i586))
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019