From 1c1c5eb6f924fc255025667e2fed4a0f5a0d4789 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 31 Mar 2022 13:25:11 +0200 Subject: [PATCH] Fix "anonymous types declared in an anonymous union" warnings They look like this: ``` CC src/processor.o In file included from /Users/mhorn/Projekte/Julia/julia.master/src/processor.cpp:10: In file included from ./processor.h:5: ./julia.h:395:9: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types] struct { ^ ./julia.h:405:9: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types] struct { ^ 2 warnings generated. ``` and come from code that was introduced by @keno in PR #43852. But it turns out that the union is not used at all! So I'm simply removing the offending union. Perhaps it is needed for some future work, but it should be trivial to add it back if needed. If that happens, I suggest a comment is added that explain why this looks similar to but has different layout compared to the `typedef _jl_purity_overrides_t` also in `julia.h`. --- src/julia.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/julia.h b/src/julia.h index b4604ff86d00e6..28fb4916acfbb4 100644 --- a/src/julia.h +++ b/src/julia.h @@ -390,26 +390,8 @@ typedef struct _jl_code_instance_t { //TODO: uint8_t absolute_max; // whether true max world is unknown // purity results - union { - uint32_t ipo_purity_bits; - struct { - uint8_t ipo_consistent:2; - uint8_t ipo_effect_free:2; - uint8_t ipo_nothrow:2; - uint8_t ipo_terminates:2; - uint8_t ipo_nonoverlayed:1; - } ipo_purity_flags; - }; - union { - uint32_t purity_bits; - struct { - uint8_t consistent:2; - uint8_t effect_free:2; - uint8_t nothrow:2; - uint8_t terminates:2; - uint8_t nonoverlayed:1; - } purity_flags; - }; + uint32_t ipo_purity_bits; + uint32_t purity_bits; jl_value_t *argescapes; // escape information of call arguments // compilation state cache