You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Neil Conway (JIRA)" <ji...@apache.org> on 2016/02/02 22:41:40 UTC

[jira] [Commented] (MESOS-4579) "Uninitialized variable" warnings with "-O3" build

    [ https://issues.apache.org/jira/browse/MESOS-4579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15129090#comment-15129090 ] 

Neil Conway commented on MESOS-4579:
------------------------------------

Is there anything to fix here? Special-casing "-O2" in {{configure.ac}} is obviously pretty fragile, but listing all the possible compiler flags that could result in emitting these warnings is also fragile (-O3, -Os, maybe -O / -O1, etc.). We could either enable {{-Wno-maybe-uninitialized}} unconditionally, or else try to fix the places in the code that trigger the warning.

> "Uninitialized variable" warnings with "-O3" build
> --------------------------------------------------
>
>                 Key: MESOS-4579
>                 URL: https://issues.apache.org/jira/browse/MESOS-4579
>             Project: Mesos
>          Issue Type: Bug
>          Components: docker
>            Reporter: James Peach
>
> GCC 5.3 (Fedora 23)
> {code}
> ../../src/docker/docker.cpp:289:17: error: ‘*((void*)& optionalPid +4)’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>    Option<pid_t> optionalPid;
>                  ^
> ../../src/docker/docker.cpp: In static member function ‘static process::Future<Nothing> Docker::_stop(const Docker&, const string&, const string&, const process::Subprocess&, bool)’:
> ../../src/docker/docker.cpp:710:35: error: ‘*((void*)& status +4)’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>      bool force = !status.isSome() || status.get() != 0;
>                                    ^
> ../../src/docker/docker.cpp: In static member function ‘static process::Future<Docker::Image> Docker::_pull(const Docker&, const process::Subprocess&, const string&, const string&, const string&, const string&, process::Future<std::__cxx11::basic_string<char> >)’:
> ../../src/docker/docker.cpp:1097:23: error: ‘*((void*)& status +4)’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>    if (status.isSome() && status.get() == 0) {
>                        ^
> cc1plus: all warnings being treated as errors
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)