summaryrefslogtreecommitdiffstats
path: root/spec/rtems/basedefs/if/dequalify-depthx.yml
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rtems/basedefs/if/dequalify-depthx.yml')
-rw-r--r--spec/rtems/basedefs/if/dequalify-depthx.yml50
1 files changed, 50 insertions, 0 deletions
diff --git a/spec/rtems/basedefs/if/dequalify-depthx.yml b/spec/rtems/basedefs/if/dequalify-depthx.yml
new file mode 100644
index 00000000..a3ad7cec
--- /dev/null
+++ b/spec/rtems/basedefs/if/dequalify-depthx.yml
@@ -0,0 +1,50 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+brief: |
+ Performs a type cast which removes qualifiers without warnings to the
+ specified type for the specified variable.
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+- Copyright (C) 2014 Paval Pisa
+definition:
+ default: ((_type)(${/c/if/uintptr_t:/name})(const volatile void *)(_var))
+ variants:
+ - definition: |
+ (const_cast<_type>(_var))
+ enabled-by:
+ - defined(${/compiler/if/cplusplus:/name})
+ - definition: |
+ ${/compiler/if/builtin-choose-expr:/name}(${/compiler/if/builtin-types-compatible-p:/name}(
+ ${typeof-refx:/name}(_ptr_level, _var),
+ ${typeof-refx:/name}(_ptr_level, _type)
+ ) || ${/compiler/if/builtin-types-compatible-p:/name}(_type, void *),
+ (_type)(_var),
+ ${/score/if/dequalify-types-not-compatible:/name}())
+ enabled-by:
+ - defined(${/compiler/if/gnuc:/name})
+description: null
+enabled-by: true
+interface-type: macro
+links:
+- role: interface-placement
+ uid: header
+- role: interface-ingroup
+ uid: group
+name: RTEMS_DEQUALIFY_DEPTHX
+notes: null
+params:
+- description: |
+ is the pointer indirection level expressed in *.
+ dir: null
+ name: _ptr_level
+- description: |
+ is the target type of the cast.
+ dir: null
+ name: _type
+- description: |
+ is the variable.
+ dir: null
+ name: _var
+return:
+ return: null
+ return-values: []
+type: interface