delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/09/20/11:45:58

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Trace-PostClient-IP: 68.147.131.211
From: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT Invalid>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: weird problem with printf()
Organization: Systematic Software
Message-ID: <i3utk0942b8j3g4odhlphp0d6crf97ftpp@4ax.com>
References: <59493f32 DOT 0409200155 DOT 7ad6ec60 AT posting DOT google DOT com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Lines: 31
Date: Mon, 20 Sep 2004 15:37:28 GMT
NNTP-Posting-Host: 24.71.223.147
X-Complaints-To: abuse AT shaw DOT ca
X-Trace: pd7tw3no 1095694648 24.71.223.147 (Mon, 20 Sep 2004 09:37:28 MDT)
NNTP-Posting-Date: Mon, 20 Sep 2004 09:37:28 MDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

fOn 20 Sep 2004 02:55:18 -0700 in comp.os.msdos.djgpp,
aniruddha1981 AT yahoo DOT co DOT in (Aniruddha) wrote:

>I am having a weird problem 
>
>The structure of my program is something like:

>     printf(someMessage);

>     printf(someMessage2);

>For the initial few runs of the loop(for), the message is displayed by the
>printf's, but after some more runs the messages are not being printed, but
>the flags are set properly.
>
>I do not know much of assembly to debug under the  disassembler view, but
>during normal debug under RHIDE, the printf seems to be executing.
>
>I am flushing the output stream after every printf. Is it because of the size
>of the translation unit or some problem with insufficient memory?

If you are really printing an array of chars directly from printf,
don't do that, as if a percent char ever appears in the array, you
will invoke undefined behaviour, always use string formats to print
char arrays with printf. 

-- 
Thanks. Take care, Brian Inglis 	Calgary, Alberta, Canada

Brian DOT Inglis AT CSi DOT com 	(Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca)
    fake address		use address above to reply

- Raw text -


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