www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/03/18/14:36:00

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-developers-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
Message-Id: <200003181934.NAA13867@hp2.xraylith.wisc.edu>
To: John Fortin <fortinj AT attglobal DOT net>
cc: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: Compile warning in times.cc and strace.exe compile problem
In-reply-to: Your message of "Sat, 18 Mar 2000 13:18:59 EST."
<38D3C893 DOT A95708A1 AT attglobal DOT net>
Date: Sat, 18 Mar 2000 13:34:22 -0600
From: Mumit Khan <khan AT NanoTech DOT Wisc DOT EDU>

John Fortin <fortinj AT attglobal DOT net> writes:
> Chris Faylor wrote:
> > 
> > On Sat, Mar 18, 2000 at 10:14:59AM -0500, John Fortin wrote:
> > >When I compile cygwin from the cvs extract, times.cc gets the following:
> > >
> > >
> > >gcc -c -g -O2 -o ./times.o times.cc
> > >/e/src/winsup/cygwin/times.cc:20: warning: inconsistent dll linkage for
> > >`time_t
> > >_timezone'. dllexport assumed.
> > >/e/src/winsup/cygwin/times.cc:21: warning: inconsistent dll linkage for
> > >`int _da
> > >ylight'. dllexport assumed.
> 
> I'm using (I think ?) the newlib from CVS which was created when I did
> 'cvs get winsup'.
> Is this the correct version?

This happens due to dllimport/export override rules, and typically
results in the correct behaviour (as is the case with Cygwin DLL).
The warning is there only to make sure developers know what's happening 
internally, and I added it since VC++ does the same.

Let's say you have some variable `foo_imported' imported from a DLL, and
it's declared in the user visible include file `foo.h'.

  /* foo.h */
  extern int foo_imported __attribute__((dllimport));

Now user that includes foo.h will get the right declaration and will link
it in from the DLL.

For the DLL code however, you should export it as the following:

  /* foo_implement.c */
  int foo_imported __attribute__((dllexport));

But let's say you forgot: 

  /* foo_implement.c */
  int foo_imported;

In which case VC++ override rule says that it should be exported instead,
which is the most likely intent. This was I imagine to help DLL code that
forgot to add the dllexport attribute. 

Regards,
Mumit

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019