From: Jeroen Hofstee <jeroen@myspectrum.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] compiler_gcc: do not redefine __gnu_attributes
Date: Thu, 18 Sep 2014 11:15:25 +0200 [thread overview]
Message-ID: <541AA2AD.2040602@myspectrum.nl> (raw)
In-Reply-To: <20140918111319.70CB.AA925319@jp.panasonic.com>
Hello Masahiro,
On 18-09-14 04:13, Masahiro Yamada wrote:
> Jeroen,
>
>> commit fb8ffd7cfc68b3dc44e182356a207d784cb30b34 "compiler*.h:
>> sync include/linux/compiler*.h with Linux 3.16" undid the changes
>> of 7ea50d52849fe8ffa5b5b74c979b60b1045d6fc9 "compiler_gcc: do
>> not redefine __gnu_attributes". Add the checks back whether these
>> macro's are already defined (as it causes a lot of noise on e.g.
>> FreeBSD where these defines are already in cdefs.h)
>>
>> As the original patch this checkpatch warning is ignored:
>> "WARNING: Adding new packed members is to be done with care"
>
> Strange.
>
> Which source files include cdefs.h?
The host std* include this file, not a source file.
> For building u-boot images, sources should
> only include headers in the u-boot source tree.
> The standard system headers should not be used
> except only a few files such as <stdarg.h>.
>
> This is the same as Linux Kernel.
Yes, and stdarg.h includes cdefs.h. So each include of common.h
causes several warnings.
>
> On the contrary, host programs are allowed to use
> standard system headers such as <stdio.h>, <stdlib.h> etc,
> where <linux/compiler.h> should not be included.
>
>
> The root cause of warnings is _not_ that
> __packed and __weak are always defined in compiler-gcc.h.
This only works properly it u-boot for the target does not depend
on any host header at all, which as you mentioned is not the case.
Hence we shouldn't be surprised if they define something in their
namespace and hence checking if that is done is fine.
> I believe the real problem is there are some source files include
> both system headers and <linux/compiler.h> at the same time.
>
No it is a header issue only. The only alternative I can think of is a
custom version of stdarg etc and I don't really like that idea.
Regards,
Jeroen
next prev parent reply other threads:[~2014-09-18 9:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-17 18:33 [U-Boot] [PATCH 0/3] Fixes for FreeBSD / clang Jeroen Hofstee
2014-09-17 18:33 ` [U-Boot] [PATCH 1/3] compiler_gcc: do not redefine __gnu_attributes Jeroen Hofstee
2014-09-18 2:13 ` Masahiro Yamada
2014-09-18 9:15 ` Jeroen Hofstee [this message]
2014-09-18 9:58 ` Masahiro Yamada
2014-09-17 18:33 ` [U-Boot] [PATCH 2/3] README.clang: update FreeBSD instructions Jeroen Hofstee
2014-09-17 18:33 ` [U-Boot] [PATCH 3/3] compiler.h: remove duplicated uninitialized_var Jeroen Hofstee
2014-09-18 2:14 ` Masahiro Yamada
2014-09-18 9:39 ` Jeroen Hofstee
2014-09-18 21:59 ` Tom Rini
2014-09-25 14:46 ` [U-Boot] [U-Boot, " Tom Rini
2014-09-18 18:10 ` [U-Boot] [PATCH v2 1/3] compiler_gcc: prevent redefining attributes Jeroen Hofstee
2014-09-19 2:36 ` Masahiro Yamada
2014-09-25 14:46 ` [U-Boot] [U-Boot, v2, " Tom Rini
2014-09-21 8:20 ` [U-Boot] [PATCH v2 2/3] README.clang: update FreeBSD instructions Jeroen Hofstee
2014-09-25 14:46 ` [U-Boot] [U-Boot, v2, " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=541AA2AD.2040602@myspectrum.nl \
--to=jeroen@myspectrum.nl \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox