Collin Funk wrote:
> Now all tests pass except for MSVC (32). The error I see there is:
> 
>     D:\a\ci-scratch\ci-scratch\testdir1\gltests\test-servent.c(25): error 
> C2440: 'initializing': cannot convert from 'servent *(__stdcall *)(const char 
> *,const char *)' to 'servent *(__cdecl *)(const char *,const char *)'
>     D:\a\ci-scratch\ci-scratch\testdir1\gltests\test-servent.c(27): error 
> C2440: 'initializing': cannot convert from 'servent *(__stdcall *)(int,const 
> char *)' to 'servent *(__cdecl *)(int,const char *)'

I see this error in the weekly gnulib CI as well.

> This is fairly simple __stdcall vs. __cdecl. I know for some modules
> like inet_ntop and inet_pton we override the functions because of this
> declaration mismatch. But in tests/test-getaddrinfo.c we just disable
> the signature test. What is the correct option in this case?

It's a matter of effort. Disabling the signature test means that code that
uses the function via a function pointer (as opposed to direct invocation)
may run into trouble. Whereas enabling it forces you to fix that case as well,
at the cost of more code in gnulib.

Use a code search [1] to determine whether getservbyname and getservbyport
frequently get used via function pointer.

Bruno

[1] maint-tools/code-search.txt




Reply via email to