You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/04/02 15:32:00 UTC

[jira] [Commented] (DISPATCH-2025) Compile using C11 language version

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

ASF GitHub Bot commented on DISPATCH-2025:
------------------------------------------

jiridanek commented on a change in pull request #1090:
URL: https://github.com/apache/qpid-dispatch/pull/1090#discussion_r606289113



##########
File path: CMakeLists.txt
##########
@@ -20,11 +20,46 @@
 cmake_minimum_required(VERSION 2.8.12)
 project(qpid-dispatch C CXX)
 
+# This effectively checks for cmake version 3.1 or later
+if (DEFINED CMAKE_C_COMPILE_FEATURES)
+    set(CMAKE_C_STANDARD 11)
+    set(CMAKE_C_STANDARD_REQUIRED ON)
+    set(CMAKE_C_EXTENSIONS ON) # gnu11
+
+    set(CMAKE_CXX_STANDARD 11)
+    set(CMAKE_CXX_STANDARD_REQUIRED ON)
+    set(CMAKE_CXX_EXTENSIONS OFF)
+else()
+    set(C_STANDARD_GNU "-std=gnu11")
+    set(C_STANDARD_Clang "-std=gnu11")
+    set(C_STANDARD_SunPro "-xc11")

Review comment:
       ```suggestion
       set(C_STANDARD_SunPro "-std=c11")
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Compile using C11 language version
> ----------------------------------
>
>                 Key: DISPATCH-2025
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-2025
>             Project: Qpid Dispatch
>          Issue Type: Improvement
>    Affects Versions: 1.16.0
>            Reporter: Jiri Daněk
>            Priority: Major
>
> All supported platforms of Dispatch can compile using C11 (or gnu11) language standard.
> There is a caveat that GCC 4.8.5 claims to support C11 atomics but it doesn't. (It does not define {{__STDC_NO_ATOMICS__}} while in fact the [{{stdatomic.h}} header is missing|https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58016].) Thankfully the Dispatch code is able to deal with the situation by using GCC-specific features, so it is not a problem.
> I do not see any downsides to requiring C11 for Dispatch compilation.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org