Altera_Forum
Honored Contributor
15 years agoProblem with gcc4 toolchain
Hello,
i have written following code to demonstrate the issue: # include <stdio.h> int main(void) { unsigned long long int long_val = 0xaaaaaaaaaaaaaaaaLLU; unsigned long vala = 0xbbbbbbbbL; unsigned long valb = 0xccccccccL; printf("%lx | %lx | %llx\r\n", vala, valb, long_val); printf("%llx | %lx | %lx\r\n", long_val, vala, valb); return 0; } using the GCC4 toolchain the output is: bbbbbbbb | cccccccc | aaaaaaaa aaaaaaaa | aaaaaaaa | bbbbbbbb using the GCC3 toolchain the output is: bbbbbbbb | cccccccc | aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa | aaaaaaaa | bbbbbbbb Using sprintf or snprintf shows the same issue. Seems that something is wrong with 64bit Integer handling in these functions. I use the NIOS SBT 10.0 on Windows 7. Is is a known bug?