-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
clang-cl warnings in 'Curl_log_cf_debug()' #10737
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
Comments
We probably need to introduce an (annoying) define for printfing the socket type, as it will be either 32 bit or 64 bit depending on platform. The timediff can probably be output with %lld / "%qd ? |
Using |
The |
With --- a/lib/curl_log.h
+++ b/lib/curl_log.h
@@ -82,8 +82,7 @@ void Curl_debug(struct Curl_easy *data, curl_infotype type,
void Curl_log_cf_debug(struct Curl_easy *data, struct Curl_cfilter *cf,
#if defined(__GNUC__) && !defined(printf) && \
- defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
- !defined(__MINGW32__)
+ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
const char *fmt, ...)
__attribute__((format(printf, 3, 4)));
#else gcc:
|
Works fine now; no warnings from clang. So could the --- a/lib/curl_log.h 2023-01-19 14:43:40
+++ b/lib/curl_log.h 2023-03-30 07:48:49
@@ -81,7 +81,7 @@
#endif
void Curl_log_cf_debug(struct Curl_easy *data, struct Curl_cfilter *cf,
-#if defined(__GNUC__) && !defined(printf) && \
+#if (defined(__GNUC__) || defined(__clang__)) && !defined(printf) && \
defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
!defined(__MINGW32__)
const char *fmt, ...)
|
We can probably also delete |
Introduces CURL_FORMAT_SOCKET_T for outputting socket numbers. Fixes curl#10737 Reported-by: Gisle Vanem Closes curl#10855
I think I'm seeing a few more of these squeaking through in 8.3.0 for 32 bit. Browsing through in each case, the format specifier is hardcoded as
|
Simply adding this patch:
and using
clang-cl
to compile with-DDEBUGBUILD
, causes these warnings incf-socket.c
andconnect.c
:(edited). I assume the same would occur with gcc on Windows (haven't tested).
Could we use some other format to account for the various
curl_socket_t
andtimediff_t
definitions?The text was updated successfully, but these errors were encountered: