Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 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 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 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/