-
Notifications
You must be signed in to change notification settings - Fork 121
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
Fix gcc compiler warning in testFun.cpp #262
Fix gcc compiler warning in testFun.cpp #262
Conversation
PR AcademySoftwareFoundation#250 changed the %lx to %llx to suppress an MSVC warning, but it introduced a gcc warning, where uint64_t is long, not long long. Better to leave it as %lx and just cast to long. It's only a printf anyway. Signed-off-by: Cary Phillips <cary@ilm.com>
@fpsunflower, can you confirm that this doesn't re-introduce the MSVC warning you fixed in #250? Turns out that change introduced a gcc warning. |
Its probably ok, but I think it would be better to explicitly cast to |
Signed-off-by: Cary Phillips <cary@ilm.com>
Got it, and it looks like my first take failed on Windows anyway. Thanks. |
IMHO it's better to keep using the platform-independent fixed-width types whenever possible, but change the print specifiers to match instead: platform-independent "PRIx64" in this case from inttypes.h |
This shoudl properly avoid warnings on all platforms. Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix gcc compiler warning in testFun.cpp PR AcademySoftwareFoundation#250 changed the %lx to %llx to suppress an MSVC warning, but it introduced a gcc warning, where uint64_t is long, not long long. Better to leave it as %lx and just cast to long. It's only a printf anyway. Signed-off-by: Cary Phillips <cary@ilm.com> * cast to unsigned long long for %llx Signed-off-by: Cary Phillips <cary@ilm.com> * In printf, bit_cast to uint<n>_t and use PRIx<n> This shoudl properly avoid warnings on all platforms. Signed-off-by: Cary Phillips <cary@ilm.com> Signed-off-by: Cary Phillips <cary@ilm.com>
* Fix gcc compiler warning in testFun.cpp PR #250 changed the %lx to %llx to suppress an MSVC warning, but it introduced a gcc warning, where uint64_t is long, not long long. Better to leave it as %lx and just cast to long. It's only a printf anyway. Signed-off-by: Cary Phillips <cary@ilm.com> * cast to unsigned long long for %llx Signed-off-by: Cary Phillips <cary@ilm.com> * In printf, bit_cast to uint<n>_t and use PRIx<n> This shoudl properly avoid warnings on all platforms. Signed-off-by: Cary Phillips <cary@ilm.com> Signed-off-by: Cary Phillips <cary@ilm.com>
PR #250 changed the %lx to %llx to suppress an MSVC warning, but it
introduced a gcc warning, where uint64_t is long, not long
long. Better to leave it as %lx and just cast to long. It's only a
printf anyway.
Signed-off-by: Cary Phillips cary@ilm.com