public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: getopt: ugly linker messages
@ 2003-09-19 22:14 Danny Smith
  2003-09-20  9:53 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Danny Smith @ 2003-09-19 22:14 UTC (permalink / raw)
  To: cygwin

Re: getopt: ugly linker messages
From: Corinna Vinschen <corinna-cygwin at cygwin dot com> 
To: cygwin at cygwin dot com 
Date: Fri, 19 Sep 2003 17:34:09 +0200 
Subject: Re: getopt: ugly linker messages 
References: <200309181953.h8IJrMWa017255@bolt.sonic.net> <20030918195607.GA11311@redhat.com>
<3F6A7C70.7030901@cwilson.fastmail.fm> <20030919064843.GM9981@cygbert.vinschen.de>
<3F6B0965.3050304@cwilson.fastmail.fm> <20030919151803.GE17232@redhat.com> 
Reply-to: cygwin at cygwin dot com 

--------------------------------------------------------------------------------

On Fri, Sep 19, 2003 at 11:18:03AM -0400, Christopher Faylor wrote:
> > On Fri, Sep 19, 2003 at 09:49:25AM -0400, Charles Wilson wrote:
> > >Perhaps a cygwin-special (e.g. doesn't go back to binutils CVS) patch? 
> > >In that case, it's a one-liner -- just change the default value of 
> > >link_info.pei386_auto_import to '1' instead of '-1' in pe.em (you might 
> > >also need to change the default in ldmain.c, but I don't think that's 
> > >necessary.)
> > 
> > I'm willing to do this but I have the same reservations that I think
> > you're expressing above, Chuck.  Also, the auto-import of data variables
> > is slower than a normal dllimport so I don't feel real comfortable about
> > making this the default.
> > 
> > I don't feel really strongly about this however, so if the consensus is
> > that this should be turned on, I'll make a cygwin-specific change to
> > binutils.
> 

I share Chris's opinion about the warning.  To me the auto-import
feature has always been a last resort.  Usually, I want to know about
the missing attribute in  declarations.

> No need.  It's just a bit annoying.
> 
> However, isn't that an error in binutils?  If I have
> 
>   extern int __declspec(dllimport) foo;
> 
> and 100 lines later I have a
> 
>   extern int foo;
> 
> 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.

That is done in GCC itself, noy binutils.  It is done that way to conform
to MS 'rules' about how ___declspec(dllimport) is handled.
Overriding the attribute also prevents an ICE in gcc so I believe the
behaviour is justified. There are actually testcases in the gcc
 testsuite that test whether this happens

Here's one (g++.dg/ext/dllimport2.C):

// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }

// PR c++/9738  Dllimport attribute is overriden by later definition/redeclaration

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++;
}

Danny

> 
> Corinna
> 
> 

http://search.yahoo.com.au - Yahoo! Search
- Looking for more? Try the new Yahoo! Search

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: getopt: ugly linker messages
  2003-09-19 22:14 getopt: ugly linker messages Danny Smith
@ 2003-09-20  9:53 ` Corinna Vinschen
  2003-09-20 14:02   ` Minor wtf database update needed? (RE: getopt: ugly linker messages) Hannu E K Nevalainen (garbage mail)
  0 siblings, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2003-09-20  9:53 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Minor wtf database update needed? (RE: getopt: ugly linker messages)
  2003-09-20  9:53 ` Corinna Vinschen
@ 2003-09-20 14:02   ` Hannu E K Nevalainen (garbage mail)
  2003-09-20 14:14     ` Igor Pechtchanski
  0 siblings, 1 reply; 4+ messages in thread
From: Hannu E K Nevalainen (garbage mail) @ 2003-09-20 14:02 UTC (permalink / raw)
  To: cygwin

> From: Corinna Vinschen

<SNIP>
> 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

$ wtf ICE
$ 

Igor?
I suspect it is something like "Internal Compiler Error" - is it?

/Hannu E K Nevalainen, B.Sc. EE - 59?16.37'N, 17?12.60'E
-- UTC+01, DST -> UTC+02  --
--END OF MESSAGE-- 

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Minor wtf database update needed? (RE: getopt: ugly linker  messages)
  2003-09-20 14:02   ` Minor wtf database update needed? (RE: getopt: ugly linker messages) Hannu E K Nevalainen (garbage mail)
@ 2003-09-20 14:14     ` Igor Pechtchanski
  0 siblings, 0 replies; 4+ messages in thread
From: Igor Pechtchanski @ 2003-09-20 14:14 UTC (permalink / raw)
  To: Hannu E K Nevalainen (garbage mail); +Cc: cygwin

On Sat, 20 Sep 2003, Hannu E K Nevalainen (garbage mail) wrote:

> > From: Corinna Vinschen
>
> <SNIP>
> > 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
>
> $ wtf ICE
> $
>
> Igor?
> I suspect it is something like "Internal Compiler Error" - is it?
>
> /Hannu E K Nevalainen, B.Sc. EE

Hannu,

You're right, it is "Internal Compiler Error".

Hmm.  My first reaction was that I didn't want the OLOCA to become a
kitchen sink of unrelated acronyms, especially with links to reasonably
comprehensive acronym lists ("the Canonical Acronym List" and
"AcronymFinder.com", the latter with a search, even).  However, after not
finding it in the CAL, and having to browse through 3 pages of results to
find it on AcronymFinder, I think there's enough reason to add it to the
OLOCA.

This will also appear in the next release of wtf (or you may sync with the
web OLOCA version by following the instructions in the README).

FWIW, the above is how I would handle acronym addition proposals for any
acronym that isn't apparently prominent on the list or obviously
Cygwin-specific.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-20 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-19 22:14 getopt: ugly linker messages Danny Smith
2003-09-20  9:53 ` Corinna Vinschen
2003-09-20 14:02   ` Minor wtf database update needed? (RE: getopt: ugly linker messages) Hannu E K Nevalainen (garbage mail)
2003-09-20 14:14     ` Igor Pechtchanski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).