Wednesday, 25 April 2012

[gccsdk] [Bug 226] New: GCC 4.1.2 Release 1 strftime problem

http://www.riscos.info/bugzilla3/show_bug.cgi?id=226

Summary: GCC 4.1.2 Release 1 strftime problem
Product: GCC/GCCSDK
Version: other
Platform: Other
OS/Version: RISC OS
Status: NEW
Severity: normal
Priority: P1
Component: C compiler
AssignedTo: John.Tytgat@aaug.net
ReportedBy: duncan_moore@ntlworld.com
Estimated Hours: 0.0


#include <stdio.h>
#include <time.h>
int main() {
time_t t=time(0);
struct tm *now=localtime(&t);
char ubuf[1024];
size_t len=strftime(ubuf,sizeof ubuf,"%a %b %e %H:%M:%S %Z %Y",now);
printf("length = %lu\n",len);
if (len) printf("string = %s\n",ubuf);
return 0;
}

With GCC 4.1.2 Release 1:

*gcc -o test time.c
*test
length = 0

Earlier versions give correct output like:

length = 28
string = Wed Apr 25 16:50:46 BST 2012

--
Configure bugmail: http://www.riscos.info/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment