leo@philmds.UUCP (Leo de Wit) (08/10/89)
In article <8908092123.AA03210@ucbvax.Berkeley.EDU> ZUCCONI@FRMOP11.BITNET writes: [] | The following program gives me 2 differents results when compiled |with sozobon C. Without optimization , I get the correct result: | 01-09-89 06:25 |and compiled with the -O flag, I get | 01-09-89- 06:2 | Has someone found and fix such "features" in the optimizer? | | |----------------------------- Cut Here --------------------------------- |#include <osbind.h> | |main() |{ | char txt[10]; | | convtime(0x1321,0x3333,txt); | | printf("%s\n",txt); |} The problem is not with the optimizer, but with your program. According to the output produced, txt[] should accomodate for at least 15 characters. Since it doesn't, the fact that it works correctly in the unoptimized case is just sheer luck. Leo.
ZUCCONI@FRMOP11.BITNET (08/23/89)
Date: 22 August 1989, 22:15:35 GMT From: J.-M. Zucconi (+33) 81666900 ZUCCONI at FRMOP11 To: INFO-ATARI16@SCORE.STANFORD.EDU Subject: A bug in Sozobon Optimizer ? In Issue #395, mcvax!hp4nl!phigate!philmds!leo@uunet.uu.net (Leo de Wit) writes: |In article <8908092123.AA03210@ucbvax.Berkeley.EDU> ZUCCONI@FRMOP11.BITNET | writes: | [] || The following program gives me 2 differents results when compiled ||with sozobon C. Without optimization , I get the correct result: || 01-09-89 06:25 ||and compiled with the -O flag, I get || 01-09-89- 06:2 || Has someone found and fix such "features" in the optimizer? || || ||----------------------------- Cut Here --------------------------------- ||#include <osbind.h> || ||main() ||{ || char txt[10]; || || convtime(0x1321,0x3333,txt); || || printf("%s\n",txt); ||} | |The problem is not with the optimizer, but with your program. According |to the output produced, txt[] should accomodate for at least 15 characters. |Since it doesn't, the fact that it works correctly in the unoptimized case |is just sheer luck. | | Leo. However, I have tried with txt[80] and the error remains.... =-=-=-=-=-=-=-=-=-=-=- Jean- Marc Zucconi ZUCCONI@FRMOP11.bitnet -=-=-=-=-=-=-=-=-=-=-=