From: Tom Rini Date: Sat, 28 Jun 2014 14:34:04 -0400 Subject: [U-Boot] __weak usage In-Reply-To: <53AEF4C4.1040108@myspectrum.nl> References: <53AEF4C4.1040108@myspectrum.nl> Message-ID: <20140628183404.GZ9006@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sat, Jun 28, 2014 at 07:00:52PM +0200, Jeroen Hofstee wrote: > Hi, > > Perhaps this is trivial for you all, but it is something I had > not realized before looking into the warnings u-boot generates > with W=1 / clang. The below "program" will compile fine with > MAKEALL (even with pedantic warnings). Since the compiler > never sees the different definition and the linker does not care, > there is no warning at all. > > If a weak prototype ever changes, running MAKEALL gives no > guarantee boards don't crash at runtime. Hence I would propose > that when adding a new __weak, both the weak and non weak > definition actually see the common prototype. And please use > __weak to reduce the noise when compiling with W=1. Indeed, __weak functions should still be listed in header files, cases that don't are a bug. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: