Skip to content
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 from

Conversation

MarcelRaad
Copy link
Member

@MarcelRaad 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.

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
Copy link

@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
Copy link

Coverage Status

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

@bagder
Copy link
Member

bagder commented Jun 24, 2017

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

@MarcelRaad
Copy link
Member Author

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.

@MarcelRaad MarcelRaad deleted the lib1521_warnings branch June 25, 2017 11:50
@MarcelRaad
Copy link
Member Author

Thanks for the review!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants