delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2020/12/10/14:49:42

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Date: Thu, 10 Dec 2020 21:45:52 +0200
Message-Id: <83tust30nj.fsf@gnu.org>
From: "Eli Zaretskii (eliz AT gnu DOT org) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
To: djgpp AT delorie DOT com
In-Reply-To: <6371c322-a0ad-b85a-1ccc-1bdfff4a8d87@gmail.com>
(djgpp AT delorie DOT com)
Subject: Re: Difficulties compiling libc from repository using gcc 10.N.0
References: <5FD1FEA1 DOT 7010304 AT gmx DOT de>
<8816d501-9f33-4d68-4235-1935a83580f6 AT gmail DOT com>
<CAA2C=vACivjbYiU7yVpyFdzKjjKB10E1tvqShLPQ6i31cuKrDA AT mail DOT gmail DOT com>
<111383e4-b3db-f346-b71c-749dee17dc9e AT gmail DOT com>
<CAA2C=vDL+YWHssNteT71jUNxYAJkxwiNXrKp1O618tY6bHHcxg AT mail DOT gmail DOT com>
<831rfx4ixg DOT fsf AT gnu DOT org> <6371c322-a0ad-b85a-1ccc-1bdfff4a8d87 AT gmail DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "J.W. Jagersma (jwjagersma AT gmail DOT com) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
> Date: Thu, 10 Dec 2020 19:55:11 +0100
> 
> >> -void (*__stdio_cleanup_hook)(void);
> >> +extern void (*__stdio_cleanup_hook)(void); /* stdio/stdiohk.c */
> > 
> > This part I don't understand: are you saying that it is no longer the
> > default that a function not explicitly declared 'static' has the
> > external linkage?  Why do we need an explicit 'extern' qualifier?
> > 
> > Thanks.
> 
> This only applies to global variables (and __stdio_cleanup_hook here is a
> function *pointer*), functions themselves still have implicit external linkage.

And global variables don't?

> I'm not a C language lawyer but this page suggests that it was always an error
> to omit 'extern' on global variable declarations.  It just wasn't reported as
> such, until now:
> 
> https://gcc.gnu.org/gcc-10/porting_to.html

That's got to break a lot of code, but OK.

- Raw text -


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