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

bugzilla-daemon at riscos.info bugzilla-daemon at riscos.info
Wed Apr 25 09:34:36 PDT 2012


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 at aaug.net
        ReportedBy: duncan_moore at 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.




More information about the gcc mailing list