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

Michael Liao michael.liao at intel.com
Fri Mar 22 10:46:07 PDT 2013


LGTM. But I am not the owner of cmake. Could cmake owners take a look of
it?
Thanks for fixing it.

- Michael

On Fri, 2013-03-22 at 18:32 +0100, Duncan Sands wrote:
> 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.





More information about the llvm-commits mailing list