lkml.org 
[lkml]   [2014]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kbuild, LLVMLinux: Add -Werror to cc-option to support clang
On 2014-09-24 20:50, Behan Webster wrote:
> On 09/24/14 05:07, Michal Marek wrote:
>> On 2014-09-23 21:28, behanw@converseincode.com wrote:
>>> From: Mark Charlebois <charlebm@gmail.com>
>>>
>>> Clang will warn about unknown warnings but will not return false
>> You mean unknown options, right?
> 2 kinds of options: flags and warnings. clang used to merely warn about
> unused/unsupported flags/warnings. It now returns errors for unknown
> flags, but not warnings (unless you specify -Werror).

Ah, unknown warning options. Now I understand.


> Getting clang to error on unused flags wasn't trivial (this change broke
> a lot of builds apparently). Fortunately we weren't the only ones who
> wanted it to behave like gcc in this case. I think it's going to be
> *much* harder to do the same for warnings. The argument given by
> supporters of the current situation is that if a warning isn't
> supported, why break the build? *sigh*

I guess the reason to accept unknown warnings opentions is compatibility
with Makefiles with hardcoded gcc-isms. BTW, GCC at some point started
to ignore unknown -Wno-* options, for everyone's good of course. That's
why we ended up with the cc-disable-warning function. If -W* options for
clang need special care, then it might be a good idea to introduce
cc-warning with the conditional -Werror for clang. There are not that
many places where we add warnings, so the patch would be still short.
That way, the possible silent failure is limited only to warning options
with clang, which is not such a big deal.

Michal


\
 
 \ /
  Last update: 2014-09-25 15:41    [W:0.054 / U:1.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site