Skip to content

test1521: fix compiler warnings#1611

Closed
MarcelRaad wants to merge 1 commit into
curl:masterfrom
MarcelRaad:lib1521_warnings
Closed

test1521: fix compiler warnings#1611
MarcelRaad wants to merge 1 commit into
curl:masterfrom
MarcelRaad:lib1521_warnings

Conversation

@MarcelRaad

@MarcelRaad MarcelRaad commented Jun 24, 2017

Copy link
Copy Markdown
Member

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

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

Coverage Status

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

@bagder

bagder commented Jun 24, 2017

Copy link
Copy Markdown
Member

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

@MarcelRaad

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

4 participants