cURL / Mailing Lists / curl-library / Single Mail

curl-library

Many linker warnings regarding ws2tcpip.h and its inline functions.

From: Thorsten Schöning <tschoening_at_am-soft.de>
Date: Sun, 27 Sep 2015 21:04:01 +0200

Hi all,

I'm building version 7.44.0 of cURL in Embarcadero C++Builder 10
Seattle and came across thousands of warnings like the following when
building the lib:

> [TLIB Warnung] Warning: public '_IN6ADDR_SETANY' in module 'slist' clashes with prior module 'amigaos'

All of those warnings are related to ws2tcpip.h, which is always
included in curl_setup.h in my case. This is OK of course because I
have those headers and such, but I don't want the warnings.

All of the functions mentioned in the warnings have a definition like
the following:

> #if defined(__CODEGEARC__)
> #if defined(__cplusplus)
> #define WS2TCPIP_INLINE __inline
> #else
> #define WS2TCPIP_INLINE
> #endif
> #elif defined(_MSC_VER)
> #define WS2TCPIP_INLINE __inline
> #else
> #define WS2TCPIP_INLINE extern inline /* GNU style */
> #endif
[...]
> WS2TCPIP_INLINE
> VOID
> IN6ADDR_SETANY(PSOCKADDR_IN6 a)
> {
> a->sin6_family = AF_INET6;
> a->sin6_port = 0;
> a->sin6_flowinfo = 0;
> IN6_SET_ADDR_UNSPECIFIED(&a->sin6_addr);
> a->sin6_scope_id = 0;
> }

In my case, __CODEGEARC__ is true, __cplusplus is not, so I guess what
is intended to be inlined is not properly, but each TU gets a public
definition of the same functions resulting in the warning.

My current workaround is to define the header guards of ws2tcpip.h
manually and curl works that way, but I don't have IPv6 support in
that case, because the needed structs are part of ws2tcpip.h.

Do you have any idea on how I could get rid of the warnings and force
properly inlining of the functions? Or am I doing something wrong with
building my lib and add to many unrelated c files?

Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: Thorsten.Schoening_at_AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-09-27