From 2933e1a01a6f49b60b4b9a2c7bd1439cbadc982a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 13 Nov 2018 14:13:09 +0200 Subject: Fix bizarre "maybe used uninitialized" GCC warnings in optional usage The warning was only issued in certain cases when sizeof(T) was 1 byte (bool, uint8_t). --- libbutl/optional.mxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libbutl/optional.mxx') diff --git a/libbutl/optional.mxx b/libbutl/optional.mxx index e7e00dd..0f18c11 100644 --- a/libbutl/optional.mxx +++ b/libbutl/optional.mxx @@ -43,7 +43,7 @@ LIBBUTL_MODEXPORT namespace butl template struct optional_data { - struct empty {}; + struct empty {char x;}; // Note: byte size is important to GCC. union { @@ -86,7 +86,7 @@ LIBBUTL_MODEXPORT namespace butl template struct optional_data { - struct empty {}; + struct empty {char x;}; // Note: byte size is important to GCC. union { -- cgit v1.1