Article View: comp.sys.atari.st
Article #3017(none)
From: ZUCCONI
Date: Wed, 09 Aug 1989 23:22
Date: Wed, 09 Aug 1989 23:22
62 lines
1844 bytes
1844 bytes
Date: 09 August 1989, 23:21:23 GMT
From: J.-M. Zucconi (+33) 81666900 ZUCCONI at FRMOP11
To: INFO-ATARI16@SCORE.STANFORD.EDU
Subj: A bug in Sozobon Optimizer ?
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);
}
convtime(date,time,p) /* gives date & time on the form DD-MM-YY HH-MM */
int date, time;
register char *p;
{
int dt[5];
register int i;
register char *t;
dt[0]=date & 0x1f;
date >>=5;
dt[1]=date & 0x0f;
date >>=4;
dt[2]=(date & 0x7f) +80;
time >>=5;
dt[4]=time & 0x3f;
time >>=6;
dt[3]= time & 0x1f;
for (i=0; i<5; i++)
dt[i] = ((dt[i]/10 << 8) | dt[i]%10 ) | 0x3030;
t=(char *)dt;
for (i=0; i<3; i++) {
*p++=*t++;
*p++=*t++;
*p++='-';
}
p--;
*p++=' ';
*p++=*t++;
*p++=*t++;
*p++=':';
*p++=*t++;
*p++=*t++;
*p='\0';
}
=-=-=-=-=-=-=-=-=-=-=-
Jean- Marc Zucconi
ZUCCONI@FRMOP11.bitnet
-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID:
<8908092123.AA03210@ucbvax.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!ucbvax!FRMOP11.BITNET!ZUCCONIShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!ucbvax!FRMOP11.BITNET!ZUCCONI From: ZUCCONI@FRMOP11.BITNET Newsgroups: comp.sys.atari.st Subject: (none) Message-ID: <8908092123.AA03210@ucbvax.Berkeley.EDU> Date: 9 Aug 89 23:22:38 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 62