From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Sat, 05 Jul 2014 15:34:17 +0200 Subject: [U-Boot] [RFC 06/10] cc-option: make it work with clang In-Reply-To: <20140610173903.9606.AA925319@jp.panasonic.com> References: <1401568344-4441-1-git-send-email-jeroen@myspectrum.nl> <1401568344-4441-7-git-send-email-jeroen@myspectrum.nl> <20140610173903.9606.AA925319@jp.panasonic.com> Message-ID: <53B7FED9.6010101@myspectrum.nl> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Masahiro, On 10-06-14 10:39, Masahiro Yamada wrote: > Hi Jeroen, > > > On Sat, 31 May 2014 22:32:20 +0200 > Jeroen Hofstee wrote: > >> By default clang will return echo a warning if an option is unknown. >> Therefore turn warnings into errors when polling for options. > As far as I tested with clang 3.5 on Ubuntu 14.04, > it looks different. > > $ clang -fno-delete-null-pointer-checks helloworld.c > clang: error: unknown argument: '-fno-delete-null-pointer-checks' > $ echo $? > 1 Yes it seems to be restricted to warning options. The -Werror=date-time causes a lot of noise e.g. when building with clang 3.4. With 3.5 this option seems to be added, but behavior for unrecognized warnings flags remained the same, see below. Regards, Jeroen [jeroen at freebsd /usr/home/jeroen]$ clang -v FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 Target: x86_64-unknown-freebsd11.0 Thread model: posix Selected GCC installation: [jeroen at freebsd /usr/home/jeroen]$ clang -Werror=date-time a.c warning: unknown warning option '-Werror=date-time' [-Wunknown-warning-option] 1 warning generated. [jeroen at freebsd /usr/home/jeroen]$ echo $? 0 [jeroen at freebsd /usr/home/jeroen]$ clang -Werror -Werror=date-time a.c error: unknown warning option '-Werror=date-time' [-Werror,-Wunknown-warning-option] [jeroen at freebsd /usr/home/jeroen]$ echo $? 1 jeroen at yellow:~$ clang -v clang version 3.5.0 (git at github.com:jhofstee/clang.git f533fd477a50467a0d96293d116f4059aa806b65) (git at github.com:jhofstee/llvm.git 6b7ff6be9c1bcf8ce440c7f1c7646fbf059562e4) Target: x86_64-unknown-linux-gnu Thread model: posix Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8 Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.1 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.1 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8 Candidate multilib: .;@m64 Selected multilib: .;@m64 jeroen at yellow:~$ clang -Werror=date-time a.c jeroen at yellow:~$ clang -Werror=date-time-newer a.c warning: unknown warning option '-Werror=date-time-newer'; did you mean '-Werror=date-time'? [-Wunknown-warning-option] 1 warning generated. jeroen at yellow:~$ echo $? 0 jeroen at yellow:~$ clang -Werror -Werror=date-time-newer a.c error: unknown warning option '-Werror=date-time-newer'; did you mean '-Werror=date-time'? [-Werror,-Wunknown-warning-option] jeroen at yellow:~$ echo $? 1