[jira] [Commented] (MESOS-2925) Invalid usage of ATOMIC_FLAG_INIT in member initialization
[ https://issues.apache.org/jira/browse/MESOS-2925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14600121#comment-14600121 ] Paul Brett commented on MESOS-2925: --- [~jvanremoortere] - I think the init macro in the initializer list use looks much better but the compiler warns against it because the behavior is undefined and therefore unsafe. BTW, I'm using clang on Linux, so I don't know if the proposed Apple tweak would help me. Invalid usage of ATOMIC_FLAG_INIT in member initialization -- Key: MESOS-2925 URL: https://issues.apache.org/jira/browse/MESOS-2925 Project: Mesos Issue Type: Bug Components: libprocess Affects Versions: 0.23.0 Reporter: Paul Brett The C++ specification states: The macro ATOMIC_FLAG_INIT shall be defined in such a way that it can be used to initialize an object of type atomic_flag to the clear state. The macro can be used in the form: atomic_flag guard = ATOMIC_FLAG_INIT; It is unspecified whether the macro can be used in other initialization contexts. Clang catches this (although reports it erroneously as a braced scaled init issue) and refuses to compile libprocess. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (MESOS-2925) Invalid usage of ATOMIC_FLAG_INIT in member initialization
[ https://issues.apache.org/jira/browse/MESOS-2925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14600084#comment-14600084 ] Joris Van Remoortere commented on MESOS-2925: - Hi [~pbrett]. Clang 3.7 does error out on OSX due to the braced scaled initializer warning. According to [~tillt] this is something that Apple tends to tweak before they provide the stable releases of clang for OSX? AFAIK the macro expands to either `{false}` or {0}. I don't see why it is harmful to keep using this to initialize the locks. I find the code in the review request harder to read due to the noise. What do you think? Invalid usage of ATOMIC_FLAG_INIT in member initialization -- Key: MESOS-2925 URL: https://issues.apache.org/jira/browse/MESOS-2925 Project: Mesos Issue Type: Bug Components: libprocess Affects Versions: 0.23.0 Reporter: Paul Brett The C++ specification states: The macro ATOMIC_FLAG_INIT shall be defined in such a way that it can be used to initialize an object of type atomic_flag to the clear state. The macro can be used in the form: atomic_flag guard = ATOMIC_FLAG_INIT; It is unspecified whether the macro can be used in other initialization contexts. Clang catches this (although reports it erroneously as a braced scaled init issue) and refuses to compile libprocess. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (MESOS-2925) Invalid usage of ATOMIC_FLAG_INIT in member initialization
[ https://issues.apache.org/jira/browse/MESOS-2925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14600104#comment-14600104 ] Paul Brett commented on MESOS-2925: --- Up for review at https://reviews.apache.org/r/35841/ Invalid usage of ATOMIC_FLAG_INIT in member initialization -- Key: MESOS-2925 URL: https://issues.apache.org/jira/browse/MESOS-2925 Project: Mesos Issue Type: Bug Components: libprocess Affects Versions: 0.23.0 Reporter: Paul Brett The C++ specification states: The macro ATOMIC_FLAG_INIT shall be defined in such a way that it can be used to initialize an object of type atomic_flag to the clear state. The macro can be used in the form: atomic_flag guard = ATOMIC_FLAG_INIT; It is unspecified whether the macro can be used in other initialization contexts. Clang catches this (although reports it erroneously as a braced scaled init issue) and refuses to compile libprocess. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (MESOS-2925) Invalid usage of ATOMIC_FLAG_INIT in member initialization
[ https://issues.apache.org/jira/browse/MESOS-2925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14600512#comment-14600512 ] Michael Park commented on MESOS-2925: - [~pbrett] I gave it a {{ShipIt}} on the review but how about we use the inline member initializer syntax instead? {code} class Obj { public: std::atomic_flag lock = ATOMIC_FLAG_INIT; }; {code} Invalid usage of ATOMIC_FLAG_INIT in member initialization -- Key: MESOS-2925 URL: https://issues.apache.org/jira/browse/MESOS-2925 Project: Mesos Issue Type: Bug Components: libprocess Affects Versions: 0.23.0 Reporter: Paul Brett The C++ specification states: The macro ATOMIC_FLAG_INIT shall be defined in such a way that it can be used to initialize an object of type atomic_flag to the clear state. The macro can be used in the form: atomic_flag guard = ATOMIC_FLAG_INIT; It is unspecified whether the macro can be used in other initialization contexts. Clang catches this (although reports it erroneously as a braced scaled init issue) and refuses to compile libprocess. -- This message was sent by Atlassian JIRA (v6.3.4#6332)