[llvm] r176341 - GCC thinks that this variable might be used uninitialized (it isn't).

Duncan Sands baldrick at free.fr
Fri Mar 22 10:32:20 PDT 2013


Hi Michael,

On 21/03/13 23:21, Michael Liao wrote:
> On Thu, 2013-03-21 at 23:17 +0100, Arnaud de Grandmaison wrote:
>> I understand your point, but do we really need this back-compatibility here
>> --- for the '-W flags' ?
>>
>> the add_(llvm_)definitions is for sure convenient because it sets the flags
>> for C and C++ at the same time, whereas the append_if only set one at a time.
>>
>> My other concern is that as far as I know, the respective ordering in the
>> compilation command line of definitions and flags depends on the cmake
>> toolchain file : we simply can not rely on that, as it could even change from
>> one revision to the other. Beside, we may want to have cross-compilation one
>> day with cmake. On the other hand, the append_if is quite clear in its intent
>> and does not have this issue.
>
> I don't mean that's the issue. The issue is LLVM specific. Its cmake
> prepares command line options through different ways. '-Wall' is added
> through 'add_definition', and '-Wno-maybe-uninitialized' is added
> through 'CMAKE_CXX_FLAGS'. We should follow a consistent way adding
> them.

I think it's reasonable to use append_if for all warning flags.  Patch attached.

Ciao, Duncan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake-warnings.diff
Type: text/x-patch
Size: 3641 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130322/782d582a/attachment.bin>


More information about the llvm-commits mailing list