mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <benjamin.bann...@mesosphere.io>
Subject Re: Review Request 48164: Suppress all warnings inside googlemock.
Date Thu, 02 Jun 2016 12:13:54 GMT

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

(Updated June 2, 2016, 2:13 p.m.)


Review request for mesos and Till Toenshoff.


Changes
-------

Address Till's comment.


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 (updated)
-----

  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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message