[
https://issues.apache.org/jira/browse/MESOS-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14531098#comment-14531098
]
Vinod Kone commented on MESOS-2690:
-----------------------------------
{quote}
Grepping for -O2 in CXXFLAGS is fairly fragile, and moderately unsafe because
it's one particular GCC optimization, which happens to be included in -O2.
Unless we implement parsing all of GCC's flags, finding which one enables the
optimization that breaks -Wno-maybe-uninitialized we've made a very, very
environment-specific patch to work around a particular bug which could quite
likely be fixed in a point release of GCC at some point rendering the code
incorrect.
{quote}
I don't follow this argument. We fixed "--enable-optimize" because we append
"-O2" to CXXFLAGS in configure.ac; this implies that we concluded that "-O2"
and "-Wno-maybe-uninitialized" could be safely used in tandem. Put another way,
if someone set CXXFLAGS in the env and did "./configure --enable-optimize" we
are still appending "-Wno-maybe-uninitialized" to CXXFLAGS. How is that safer?
> --enable-optimize build fails with maybe-uninitialized
> ------------------------------------------------------
>
> Key: MESOS-2690
> URL: https://issues.apache.org/jira/browse/MESOS-2690
> Project: Mesos
> Issue Type: Bug
> Components: build
> Environment: GCC 4.8 -> 4.9
> Reporter: Joris Van Remoortere
> Assignee: Joris Van Remoortere
> Priority: Blocker
>
> When building with the `enable-optimize` flag, the build fails with
> `maybe-uninitialized' errors.
> This is due to a bug in GCC when building optimized code triggering false
> positives for this warning. Please see:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59970
> We can disable this warning when using GCC + --enable-optimize.
> A quick work-around until there is a patch:
> ../configure CXXFLAGS="-Wno-maybe-uninitialized" <your-other-flags-here>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)