-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor change to asserts, fix compiler warnings. #11
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good after resolving the printing feedback
printf("hexadecimal unsigned int: TODO\n", i); | ||
printf("float: TODO\n", d); | ||
printf("long: TODO\n", l); | ||
printf("pointer: TODO\n", p); | ||
#endif | ||
cr_assert_file_contents_eq_str(stdout, | ||
"char: J\nint: -1\nunsigned int: 4294967295\nhexadecimal unsigned int: " | ||
"ffffffff\nfloat: 3.140000\nlong: 3735928559\npointer: 0x400\n"); | ||
"ffffffff\nfloat: 3.140000\nlong: 3735928559\npointer: 00000400\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the intended solution of using the %p
format specifier to print p
, this solution should be 0x400
.
If you experienced some other behavior, let me know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Windows 7 x64, GCC from MingW
with %p GCC version 4.5.2 x86 gave me 00000400
with %p GCC version 4.7.2 x64 gave me 0000000000000400
I am compiling against -std=c99 - maybe that is the cause?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking into some MingW tickets/issues related to printf
and this one seems promising, thought I haven't had the chance to parse through everything yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you want to proceed? I can remove the change of address 0x400 in the PR if you want me to
Hi, final PR with last changes/fixes I found in the koans. Thank you for C Koans.