www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/28/09:38:02

Date: Mon, 28 Sep 1998 16:37:28 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "EFT.Eric Devolder" <eric DOT devolder AT eft DOT be>
cc: djgpp AT delorie DOT com
Subject: Re: Program goes wrong when optimized under gcc 2.8
In-Reply-To: <D1DE20405ECBD011B2AC0060974BC6EA04F921@DBSERVER>
Message-ID: <Pine.SUN.3.91.980928163516.735E-100000@is>
MIME-Version: 1.0

On Mon, 28 Sep 1998, EFT.Eric Devolder wrote:

> > When I compile the program like this: gcc -o hot2std.exe hot2std.c
> > it works perfeclty.
> > If I try to compile with optimization (gcc -O[1,2 or 3] -o hot2std.exe
> > hot2std.c), I get strange outputs, compared to those of the debug
> > version.

This line is the villain:

	sprintf(temp,"0002%06.6ldA%019.19s  \n"

This produces 33 characters, including the terminating '\0', whereas 
temp[] is declared as "char temp[32];".

I don't know whether there are any more problems in your program.

- Raw text -


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