This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR C/19152, IMA and extern inline


A christmas present for --enable-intermodule users. Even though the code
which is rejected is not a regression, this is a build regression and
really should be fixed for 4.0.0.
Take the following files:
------ a.c ------
extern inline void f(void) { }
------ b.c ------
void f(void) { }
------ c.c ------
extern inline void f(void) { }


Compiling in any order should work but currently when b.c is listed
before any of the other files, this is rejected saying that f is
redefined.

This patch cleans up the code which rejects the code and fixes the
problem by allowing this and making always the function declaration
in b.c be the function declaration.

OK? Bootstrapped and tested with no regressions.  Plus it fixes
building with --enable-intermodule.

Thanks,
Andrew Pinski

ChangeLog:
	* c-decl.c (diagnose_mismatched_decls): Accept "extern inline" declared
	after the full declaration if the are in two different TUs.


Attachment: temp.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]