From 87fc9722a20b247e1971789a92a8db025aa709ac Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 18 Oct 2023 08:10:12 -0700 Subject: [PATCH] Further improve my fixes to 1984/decot When I restored the macros it allowed for reinstating the 'union' instead of 'static struct' and it also allowed for reintroducing the 'x' (which is '=') in that line so that it looks just like the original: union tag u x{4}; For documentation purposes this was added in the thanks file (in the same part of that entry, the making it look more like the original which is a worthy goal) as well. --- 1984/decot/decot.c | 2 +- thanks-for-fixes.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/1984/decot/decot.c b/1984/decot/decot.c index 1069eb7d9..7aa30e532 100644 --- a/1984/decot/decot.c +++ b/1984/decot/decot.c @@ -21,7 +21,7 @@ int dup, signal; goto _0; _O: while (!(k['a'] <<= - dup)) { /*/*\*/ - static struct tag u = {4}; + union tag u x{4}; } } diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 482bc9d02..3b3d3110f 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -127,6 +127,10 @@ char x {sizeof( and changing the type of `k` to be an `int`. +Additionally, because of the `#define union static struct` there is no need to +have in the code `static struct` as we can have it like the original code which +has it as `union`. + Originally Yusuke supplied a patch so that this entry would compile with gcc - but not clang - or at least some versions.