Repository navigation
Conversation
|
I've pushed a fix for some of these CI warnings, some seem unnecessary like require a prototype for every function in an example. Some I didn't push a fix for, they seem arguably wrong, for example: Some of those variables are not yet known so they should initialize to zero, this is common practice, here is the code: struct transfer {
const char *url, *bodyfile, *logfile;
struct mem log;
FILE *bodyfp;
CURL *curl;
};
struct transfer transfer[] = {
{ "https://httpbin.org/get", "200.txt", "200_transfer_log.txt", },
{ "https://httpbin.org/status/400", "400.txt", "400_transfer_log.txt", },
};Here is another one: It may be true for that compiler at that time but it may not be false for a different compiler. It is an overflow check, just because it tests always false for that compiler doesn't mean anything. So in this case I would have to get rid of the overflow checks, which seems restrictive. |
It can only ever be true if sizeof(unsigned int) == sizeof(size_t), which probably implies a 32 bit architecture. And |
|
AFAICT it's not guaranteed that INT_MAX is going to be less than SIZE_MAX because it's not guaranteed that SIZE_MAX >= UINT_MAX. Therefore positive int x may not be a subset of size_t range and it should be checked for overflow. Practically though it's unlikely. I think it's more correct to check but I will remove it to satisfy CI. |
|
Here's another one that's restrictive: I'm going to put in a pragma to ignore this specific one, we do that elsewhere |
1217c1b to
65f13b8
Compare
|
It looks like |
- Add an example that demonstrates per-transfer verbose logging to memory. The transfer's log is written to disk only if the transfer fails. Closes curl#18668
|
Why is vsnprintf now banned from examples code? |
@vszakats ? I think we should allow it for examples. It keeps them simple and the fact that it is broken in some older Microsoft compilers is not reason enough to avoid it there I think. |
It just wasn't used before, and thus I did not add it to the local .checksrc. It can be added there if needed. edit: done via #18970 |
Ref: curl#18668 Follow-up to b12da22 curl#18866
Ref: #18668 (comment) Follow-up to b12da22 #18866 Closes #18970
- include `windows.h` after `winsock2.h` via `curl/curl.h`. - avoid `errno` for WinCE. - avoid `_vscprintf` for WinCE. Ref: 4535532 curl#18843 Follow-up to 0780de2 curl#18668 Closes curl#19016
The transfer's log is written to disk only if the transfer fails.
Closes #xxxx