diff options
author | Marcel Raad <Marcel.Raad@teamviewer.com> | 2017-06-24 16:39:27 +0200 |
---|---|---|
committer | Marcel Raad <Marcel.Raad@teamviewer.com> | 2017-06-25 13:46:51 +0200 |
commit | e8a4da67f5d041f6fac0a1fea20d58bf5f151691 (patch) | |
tree | 6aee9642ae16b601fe7a675ae37e105c82bae4d0 /tests/libtest/mk-lib1521.pl | |
parent | ceff21ab76f83e7ba83dbba79eecd67e49fa414c (diff) | |
download | gnurl-e8a4da67f5d041f6fac0a1fea20d58bf5f151691.tar.gz gnurl-e8a4da67f5d041f6fac0a1fea20d58bf5f151691.tar.bz2 gnurl-e8a4da67f5d041f6fac0a1fea20d58bf5f151691.zip |
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
9b167fd090f596eac828817d48c247eeae53407f.
Closes https://github.com/curl/curl/pull/1611
Diffstat (limited to 'tests/libtest/mk-lib1521.pl')
-rw-r--r-- | tests/libtest/mk-lib1521.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/libtest/mk-lib1521.pl b/tests/libtest/mk-lib1521.pl index d59db0d7a..e60bce5cc 100644 --- a/tests/libtest/mk-lib1521.pl +++ b/tests/libtest/mk-lib1521.pl @@ -27,6 +27,8 @@ # minimum and maximum long signed values my $minlong = "LONG_MIN"; my $maxlong = "LONG_MAX"; +# maximum long unsigned value +my $maxulong = "ULONG_MAX"; print <<HEADER /*************************************************************************** @@ -62,9 +64,8 @@ struct data { #define LO $minlong #define HI $maxlong -#define OFF_VAL (curl_off_t) 3123123123 #define OFF_LO (curl_off_t) LO -#define OFF_HI (curl_off_t) HI +#define OFF_HI (curl_off_t) $maxulong #define OFF_NO (curl_off_t) 0 /* Unexpected error. @@ -235,7 +236,7 @@ while(<STDIN>) { elsif($type eq "OFF_T") { # play conservative to work with 32bit curl_off_t print "${pref} OFF_NO);\n$check"; - print "${pref} OFF_VAL);\n$check"; + print "${pref} OFF_HI);\n$check"; print "${pref} OFF_LO);\n$check"; } else { |