From 82317aed7d4b6acd4fb65441a106f9de4d9c8926 Mon Sep 17 00:00:00 2001 From: Angelo Mantellini Date: Thu, 17 Jan 2019 10:57:04 +0100 Subject: add clang directives to avoid warnings Change-Id: I1ed298176ad1403ed089177a3cce4264f028bbbd Signed-off-by: Angelo Mantellini --- libparc/parc/algol/parc_Object.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'libparc/parc/algol/parc_Object.h') diff --git a/libparc/parc/algol/parc_Object.h b/libparc/parc/algol/parc_Object.h index b1a48558..ac7e9652 100644 --- a/libparc/parc/algol/parc_Object.h +++ b/libparc/parc/algol/parc_Object.h @@ -598,7 +598,33 @@ const PARCObjectDescriptor *parcObject_SetDescriptor(PARCObject *object, const P * The new `PARCObjectDescriptor` uses the existing `PARCObjectDescriptor` as the super-type of the new descriptor. */ +#ifdef __clang__ #define parcObject_Extends(_subtype, _superType, ...) \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Winitializer-overrides\"") \ + parcObjectDescriptor_Declaration(_subtype) = { \ + .super = &parcObject_DescriptorName(_superType), \ + .name = #_subtype, \ + .objectSize = 0, \ + .objectAlignment = 0, \ + .destroy = NULL, \ + .destructor = NULL, \ + .release = NULL, \ + .copy = NULL, \ + .toString = NULL, \ + .equals = NULL, \ + .compare = NULL, \ + .hashCode = NULL, \ + .toJSON = NULL, \ + .display = NULL, \ + .isLockable = true, \ + .typeState = NULL, \ + __VA_ARGS__ \ + }; \ + _Pragma("GCC diagnostic pop") \ + const PARCObjectDescriptor parcObject_DescriptorName(_subtype) +#else + #define parcObject_Extends(_subtype, _superType, ...) \ _Pragma("GCC diagnostic ignored \"-Woverride-init\"") \ parcObjectDescriptor_Declaration(_subtype) = { \ .super = &parcObject_DescriptorName(_superType), \ @@ -621,6 +647,7 @@ const PARCObjectDescriptor *parcObject_SetDescriptor(PARCObject *object, const P }; \ _Pragma("GCC diagnostic warning \"-Woverride-init\"") \ const PARCObjectDescriptor parcObject_DescriptorName(_subtype) +#endif /** * Define a new PARC Object implementation, by composing a new PARC Object Descriptor referencing an old one. -- cgit 1.2.3-korg