cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Threadsafe libcurl warnings

From: Wham Bang <wham_bang_at_yahoo.com>
Date: Thu, 30 Mar 2000 11:58:32 -0800 (PST)

Hi,

--- Daniel Stenberg <Daniel.Stenberg_at_netinsight.se> wrote:
> Wham Bang wrote:
>
> > I've just switched to building libcurl threadsafe on NT, and I am
> > seeing some warnings in getdate.c which have me somewhat worried.
>
> [snip]
>
> > getdate.y(469) : warning C4273: 'gmtime' : inconsistent dll
> > linkage. dllexport assumed.
>
> With the risk of revealing my VC++ cluelessness, what the heck does
> "inconsistent dll linkage" mean?
>

Well, I'm not 100% sure myself. :) This is what the MSDN entry
says:

! The specified member function was declared in a class with
! dllexport linkage, and then was imported. This warning can
! also be caused by declaring a member function in a class
! with dllimport linkage as neither imported nor static nor
! inline.

I *think* that *somehow* the compiler thinks that the code
in getdate.c is trying to redefine gmtime() (and localtime()
and mktime()), and it's warning us about it. There's
another entry in MSDN that leads me to think it's harmless.
It describes how one might try to replace the function _matherr()
when using the dynamically linked C runtime and says

! The C4273 warning is generated because the compiler has
! detected a redefinition of _matherr after already seeing
! a prototype that specifies that _matherr is being imported.
!
! RESOLUTION
! It is not possible to replace the default version of _matherr
! when using the dynamically linked version of the C run-time
! library.

Since I don't the code in getdate.c doesn't seem to be trying to
redefine those functions anyway, I think it's OK.

>
> I assume gmtime(), localtime() and mktime() are documented somewhere
> in VC++ and if that docs doesn't say they're unsafe to use in a
> multi-threaded environment, I can't see any reason why they
> would fail.
>

Yes, there are thread-safe versions of these functions.

=====
Wham! <wham_bang_at_yahoo.com>

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
Received on 2000-03-30