delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/09/20/05:49:35

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Sat, 20 Sep 2003 11:48:44 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: getopt: ugly linker messages
Message-ID: <20030920094844.GP9981@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20030919213204 DOT 52259 DOT qmail AT web21406 DOT mail DOT yahoo DOT com>
Mime-Version: 1.0
In-Reply-To: <20030919213204.52259.qmail@web21406.mail.yahoo.com>
User-Agent: Mutt/1.4.1i

On Sat, Sep 20, 2003 at 07:32:04AM +1000, Danny Smith wrote:
> > why is then the information about the __declspec removed?  Shouldn't
> > that information be kept?  AFAIK, the "extern" storage class shouldn't
> > change any information already known about the variable in question.
> > It should complain about e.g. conflicting types but it should never
> > change what's already there.
> 
> Overriding the attribute also prevents an ICE in gcc so I believe the
> behaviour is justified. There are actually testcases in the gcc

Well... I'm not quite sure if circumventing a potential compiler bug
actually justifies a potential misbehaviour...

> void __attribute__((dllimport)) Bar(void);
> void __attribute__((dllimport)) Baz(void);
> __attribute__((dllimport)) int Biz;
> __attribute__((dllimport)) int Boz;
> 
> void Foo(void)
>   {
>     Bar();
>     Baz();
>     Biz++;	 
>     Boz++;	 
>   }
>  
> void Bar(void)
>   {			// { dg-warning "defined" }
>   }
> 
> void Baz(void);		// { dg-warning "redeclared" }
> extern int Biz;		// { dg-warning "redeclared" }
> int Boz;		// { dg-warning "defined" }
> 
> void foo()
> {
>   Biz++;
> }

The above case is imho somewhat borderline.  It defines Biz with
dllimport, but it's missing an `extern'.  What I mean is, having two
extern declarations, one with and the second without dllimport.  The
second should not touch the already existing declaration.  I don't
see why this should result in an ICE.  The other cases in the testcase
are absolutely ok, though.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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