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

test1521: fix compiler warnings #1611

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@MarcelRaad
Member

MarcelRaad commented Jun 24, 2017

The integer literal 3123123123 doesn't fit into a 32-bit signed
integer, so GCC with 32-bit long warns in C90 mode:
this decimal constant is unsigned only in ISO C90 [enabled by default]
Fix this by using ULONG_MAX, which should fit in any curl_off_t and has
the correct suffix to not issue any warnings.
Also adds the missing CURLOPT_REQUEST_TARGET from commit
9b167fd.

test1521: fix compiler warnings
The integer literal 3123123123 doesn't fit into a 32-bit signed
integer, so GCC with 32-bit long warns in C90 mode:
this decimal constant is unsigned only in ISO C90 [enabled by default]
Fix this by using ULONG_MAX, which should fit in any curl_off_t and has
the correct suffix to not issue any warnings.
Also adds the missing CURLOPT_REQUEST_TARGET from commit
9b167fd.
@mention-bot

This comment has been minimized.

mention-bot commented Jun 24, 2017

@MarcelRaad, thanks for your PR! By analyzing the history of the files in this pull request, we identified @dfandrich and @bagder to be potential reviewers.

@coveralls

This comment has been minimized.

coveralls commented Jun 24, 2017

Coverage Status

Coverage decreased (-0.03%) to 73.833% when pulling a55449c on MarcelRaad:lib1521_warnings into e5d6aa8 on curl:master.

@bagder

This comment has been minimized.

Member

bagder commented Jun 24, 2017

I'm confused. Isn't ULONG_MAX an even larger value?

@MarcelRaad

This comment has been minimized.

Member

MarcelRaad commented Jun 24, 2017

Yes, it is. But is has the UL suffix, so it has the same defined behavior with all language standards. (The alternative would be to add the UL suffix.)
Without a suffix, integers literals that are too big to fit into a signed long become unsigned long in C90, while they become signed long long in C99 and later.

@bagder

bagder approved these changes Jun 24, 2017

@MarcelRaad MarcelRaad deleted the MarcelRaad:lib1521_warnings branch Jun 25, 2017

@MarcelRaad

This comment has been minimized.

Member

MarcelRaad commented Jun 25, 2017

Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment