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

Chun-Hung Hsiao commented on MESOS-8724:
----------------------------------------

{noformat}
commit 97c6017135c3a8c086508724359b93700b03387d (HEAD -> test, upstream/master)
Author: Chun-Hung Hsiao <[email protected]>
Date:   Fri Mar 23 12:45:15 2018 -0700

    Temporarily disabled CSI proto compilation when gRPC is disabled.

    The `major` and `minor` macros defined on some systems conflict with
    field names in the CSI spec proto, so its compilation is temporarily
    disabled for now until CSI is bumped to 0.2, where those field are
    removed.

    Review: https://reviews.apache.org/r/66255
{noformat}

> G++ Warning about libc system macros `major` and `minor` prevents Mesos build
> -----------------------------------------------------------------------------
>
>                 Key: MESOS-8724
>                 URL: https://issues.apache.org/jira/browse/MESOS-8724
>             Project: Mesos
>          Issue Type: Bug
>            Reporter: Benno Evers
>            Assignee: Chun-Hung Hsiao
>            Priority: Major
>
> 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:
> {noformat}
> ../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 {
> {noformat}
> The root cause is that csi.proto defines the following protobuf message:
> {noformat}
> message Version {
>   uint32 major = 1;  // This field is REQUIRED.
>   uint32 minor = 2;  // This field is REQUIRED.
>   uint32 patch = 3;  // This field is REQUIRED.
> }
> {noformat}
> The generated C++ in `csi.pb.h` headers will contain, amongst others, the 
> following function:
> {noformat}
> #include <string>
> // [6000 lines of code...]
> inline ::google::protobuf::uint32 Version::major() const {
>   // @@protoc_insertion_point(field_get:csi.Version.major)
>   return major_;
> }
> {noformat}
> And the recursive include structure of the header `<string>` leads to 
> `stdlib.h` as follows:
> {noformat}
> .       /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{noformat}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to