[rtems-central commit] spec: Avoid -Wundef warnings in API header

Sebastian Huber sebh at rtems.org
Sat Mar 23 09:51:46 UTC 2024


Module:    rtems-central
Branch:    master
Commit:    3f8b04d6a759cf6d8f5705b688208075fcbd6138
Changeset: http://git.rtems.org/rtems-central/commit/?id=3f8b04d6a759cf6d8f5705b688208075fcbd6138

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Sat Mar 23 10:50:33 2024 +0100

spec: Avoid -Wundef warnings in API header

---

 spec/rtems/basedefs/if/alignof.yml       | 8 ++++++--
 spec/rtems/basedefs/if/no-return.yml     | 8 ++++++--
 spec/rtems/basedefs/if/static-assert.yml | 8 ++++++--
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/spec/rtems/basedefs/if/alignof.yml b/spec/rtems/basedefs/if/alignof.yml
index e9299228..c0011137 100644
--- a/spec/rtems/basedefs/if/alignof.yml
+++ b/spec/rtems/basedefs/if/alignof.yml
@@ -18,7 +18,9 @@ definition:
       params: []
       return: null
     enabled-by:
-    - ${/compiler/if/cplusplus:/name} >= 201103L
+      and:
+      - defined( ${/compiler/if/cplusplus:/name} )
+      - ${/compiler/if/cplusplus:/name} >= 201103L
   - definition:
       attributes: null
       body: |
@@ -26,7 +28,9 @@ definition:
       params: []
       return: null
     enabled-by:
-    - ${/compiler/if/stdc-version:/name} >= 201112L
+      and:
+      - defined( ${/compiler/if/stdc-version:/name} )
+      - ${/compiler/if/stdc-version:/name} >= 201112L
 description: null
 enabled-by: true
 index-entries: []
diff --git a/spec/rtems/basedefs/if/no-return.yml b/spec/rtems/basedefs/if/no-return.yml
index 70413c1e..a9953ee7 100644
--- a/spec/rtems/basedefs/if/no-return.yml
+++ b/spec/rtems/basedefs/if/no-return.yml
@@ -10,11 +10,15 @@ definition:
   - definition: |
       [[noreturn]]
     enabled-by:
-    - ${/compiler/if/cplusplus:/name} >= 201103L
+      and:
+      - defined( ${/compiler/if/cplusplus:/name} )
+      - ${/compiler/if/cplusplus:/name} >= 201103L
   - definition: |
       _Noreturn
     enabled-by:
-    - ${/compiler/if/stdc-version:/name} >= 201112L
+      and:
+      - defined( ${/compiler/if/stdc-version:/name} )
+      - ${/compiler/if/stdc-version:/name} >= 201112L
   - definition: |
       __attribute__(( __noreturn__ ))
     enabled-by:
diff --git a/spec/rtems/basedefs/if/static-assert.yml b/spec/rtems/basedefs/if/static-assert.yml
index 152cd291..28c27051 100644
--- a/spec/rtems/basedefs/if/static-assert.yml
+++ b/spec/rtems/basedefs/if/static-assert.yml
@@ -19,7 +19,9 @@ definition:
       params: []
       return: null
     enabled-by:
-    - ${/compiler/if/cplusplus:/name} >= 201103L
+      and:
+      - defined( ${/compiler/if/cplusplus:/name} )
+      - ${/compiler/if/cplusplus:/name} >= 201103L
   - definition:
       attributes: null
       body: |
@@ -27,7 +29,9 @@ definition:
       params: []
       return: null
     enabled-by:
-    - ${/compiler/if/stdc-version:/name} >= 201112L
+      and:
+      - defined( ${/compiler/if/stdc-version:/name} )
+      - ${/compiler/if/stdc-version:/name} >= 201112L
 description: null
 enabled-by: true
 index-entries: []



More information about the vc mailing list