Details
Description
On linux systems, the header `<sys/sysmacros.h>` defines three macros called makedev(), major() and minor(). (See also http://man7.org/linux/man-pages/man3/makedev.3.html)
Trying to compile Mesos using g++ 7.2.0 leads to the following warning:
../include/csi/csi.pb.h:6042:13: error: In the GNU C Library, "minor" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "minor", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including <sys/types.h>. [-Werror] inline ::google::protobuf::uint32 Version::minor() const {
The root cause is that csi.proto defines the following protobuf message:
message Version { uint32 major = 1; // This field is REQUIRED. uint32 minor = 2; // This field is REQUIRED. uint32 patch = 3; // This field is REQUIRED. }
The generated C++ in `csi.pb.h` headers will contain, amongst others, the following function:
#include <string> // [6000 lines of code...] inline ::google::protobuf::uint32 Version::major() const { // @@protoc_insertion_point(field_get:csi.Version.major) return major_; }
And the recursive include structure of the header `<string>` leads to `stdlib.h` as follows:
. /usr/include/c++/7/string .. /usr/include/c++/7/bits/basic_string.h ... /usr/include/c++/7/ext/string_conversions.h .... /usr/include/c++/7/cstdlib ..... /usr/include/stdlib.h ...... /usr/include/x86_64-linux-gnu/sys/types.h ....... /usr/include/x86_64-linux-gnu/sys/sysmacros.h
Attachments
Issue Links
- is blocked by
-
MESOS-8649 CSI Spec v0.2 Support
-
- Resolved
-
- is related to
-
MESOS-8749 CSI proto is always included in the build when using CMake
-
- Resolved
-