-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/48164/
-----------------------------------------------------------

Review request for mesos and Till Toenshoff.


Repository: mesos


Description
-------

Current clang-3.9.0 `be8f8b5` will always perform a (mostly) syntactic
check that no direct `nullptr` dereferences are performed (emitted as
`-Wnull-dereference`). Dereferencing a `nullptr` is undefined
behavior.

The bundled googlemock sources contain such an instance when this
template is instantiated (it is):

    template <typename T>
    inline T Invalid() {
      return const_cast<typename remove_reference<T>::type&>(
          *static_cast<volatile typename remove_reference<T>::type*>(NULL));
    }

Note that this was fixed upstream with `b5c81098` which was merged
into googletest `master` on 2014-01-29, but not yet part of a released
version (of which the last one was on 2013-09-19).

As mesos is compiled with `-Werror` and we apply the same kinds of
warning filters to both mesos and googlemock, above code leads to
mesos being rejected by current clang.

In this commit we change the way googlemock headers are added from
`-I` to `-isystem`; the latter of these instructs the compiler to
assume the added path contains system headers which suppresses all
warnings originating from the headers found there.


Diffs
-----

  src/Makefile.am c0be66ab28c452e217fe7c7ead8b1b3c283908cc 

Diff: https://reviews.apache.org/r/48164/diff/


Testing
-------

Tested on a number of Linux configurations in internal CI.


Thanks,

Benjamin Bannier

Reply via email to