From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28175 invoked by alias); 20 Sep 2003 09:48:47 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 28168 invoked from network); 20 Sep 2003 09:48:45 -0000 Received: from unknown (HELO cygbert.vinschen.de) (80.132.105.94) by sources.redhat.com with SMTP; 20 Sep 2003 09:48:45 -0000 Received: by cygbert.vinschen.de (Postfix, from userid 500) id 2A5155830F; Sat, 20 Sep 2003 11:48:44 +0200 (CEST) Date: Sat, 20 Sep 2003 09:53:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: getopt: ugly linker messages Message-ID: <20030920094844.GP9981@cygbert.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20030919213204.52259.qmail@web21406.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030919213204.52259.qmail@web21406.mail.yahoo.com> User-Agent: Mutt/1.4.1i X-SW-Source: 2003-09/txt/msg01327.txt.bz2 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@cygwin.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/