Conversation
| struct curl_forms formarray[3]; | ||
| size_t formlength = 0; | ||
| char flbuf[32]; | ||
| long contentlength = 0; |
There was a problem hiding this comment.
shouldn't this be a curl_off_t ?
There was a problem hiding this comment.
The deprecated CURLFORM_CONTENTSLENGTH used here uses long. I used the same cast sequence as in formdata.c. The newer CURLFORM_CONTENTLEN uses curl_off_t. If you want, I can switch to that in a separate commit before this one.
| formarray[0].value = data; | ||
| formarray[1].option = CURLFORM_CONTENTSLENGTH; | ||
| formarray[1].value = (char *) strlen(data) - 1; | ||
| formarray[1].value = (char *)(size_t)contentlength; |
There was a problem hiding this comment.
and this too. Even if they're highly likely to use the same size...
| goto test_cleanup; | ||
| } | ||
|
|
||
| contentlength = (long)(strlen(data) - 1); |
|
@MarcelRaad, what's the reason this is marked for next feature window and can't go in already now? |
|
@bagder The reason at that time was that I thought I wouldn't have enough time to see if all autobuilds pass without new warnings and fix them if not for 7.61.1. As the release date is now September 5, I'll merge right now and watch the autobuilds. Thanks! |
|
Excellent! 👍 |
Enable pedantic-errors for GCC >= 5 with --enable-werror. Before GCC 5, pedantic-errors was synonymous to -Werror=pedantic [0], which is still the case for clang [1]. With GCC 5, it became complementary [2]. Also fix a resulting error in acinclude.m4 as main's return type was missing, which is illegal in C99. [0] https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Warning-Options.html [1] https://clang.llvm.org/docs/UsersManual.html#options-to-control-error-and-warning-messages [2] https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/Warning-Options.html Closes curl#2747
This warning used to be enabled only for clang as it's a bit stricter on GCC. Silence the remaining occurrences and enable it on GCC too. Closes curl#2747
This enables level 4 instead of the default level 3, which of the currently used comments only allows /* FALLTHROUGH */ to silence the warning. Closes curl#2747
This enables the following additional warnings: -Wold-style-definition -Warray-bounds=2 instead of the default 1 -Wformat=2, but only for GCC 4.8+ as Wno-format-nonliteral is not respected for older versions -Wunused-const-variable, which enables level 2 instead of the default 1 -Warray-bounds also in debug mode through -ftree-vrp -Wnull-dereference also in debug mode through -fdelete-null-pointer-checks Closes curl#2747
7e605fb to
7e34a58
Compare
Enable pedantic-errors for GCC >= 5 with --enable-werror. Before GCC 5, pedantic-errors was synonymous to -Werror=pedantic [0], which is still the case for clang [1]. With GCC 5, it became complementary [2]. Also fix a resulting error in acinclude.m4 as main's return type was missing, which is illegal in C99. [0] https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Warning-Options.html [1] https://clang.llvm.org/docs/UsersManual.html#options-to-control-error-and-warning-messages [2] https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/Warning-Options.html Closes curl#2747
This warning used to be enabled only for clang as it's a bit stricter on GCC. Silence the remaining occurrences and enable it on GCC too. Closes curl#2747
This enables level 4 instead of the default level 3, which of the currently used comments only allows /* FALLTHROUGH */ to silence the warning. Closes curl#2747
This enables the following additional warnings: -Wold-style-definition -Warray-bounds=2 instead of the default 1 -Wformat=2, but only for GCC 4.8+ as Wno-format-nonliteral is not respected for older versions -Wunused-const-variable, which enables level 2 instead of the default 1 -Warray-bounds also in debug mode through -ftree-vrp -Wnull-dereference also in debug mode through -fdelete-null-pointer-checks Closes curl#2747
This enables the following GCC flags:
When building with
--enable-werror:-pedantic-errorsfor GCC >= 5, which rejects some constructs which are no valid C and turns some undefined behavior into compile errorsWhen building with
--enable-warnings:-Wbad-function-cast, which was already enabled for clang, but not for GCC as it's a little stricter there - would have found telnet.c warning #2696 also with GCC-Wimplicit-fallthrough=4instead of the default 3, which makes the fallthrough comments more uniform-Wold-style-definition-ftree-vrpand-fdelete-null-pointer-checks, so that-Warray-boundsand-Wnull-dereferencealso work without--enable-optimize-Wformat,-Warray-bounds, and-Wunused-const-variableAlso removes some unused definitions, but unfortunately the corresponding warning flag cannot be enabled as some occurrences are hard to fix.
Tested with