delorie.com/archives/browse.cgi | search |
> 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.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |