Skip to content

Commit 098bce0

Browse files
committed
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`.
1 parent f536b81 commit 098bce0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/julia.h

+7
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ typedef struct _jl_line_info_node_t {
230230
intptr_t inlined_at;
231231
} jl_line_info_node_t;
232232

233+
// the following mirrors `struct EffectsOverride` in `base/compiler/types.jl`
233234
typedef union __jl_purity_overrides_t {
234235
struct {
235236
uint8_t ipo_consistent : 1;
@@ -390,6 +391,8 @@ typedef struct _jl_code_instance_t {
390391
//TODO: uint8_t absolute_max; // whether true max world is unknown
391392

392393
// purity results
394+
#ifdef JL_USE_ANON_UNIONS_FOR_PURITY_FLAGS
395+
// see also encode_effects() and decode_effects() in `base/compiler/types.jl`,
393396
union {
394397
uint32_t ipo_purity_bits;
395398
struct {
@@ -410,6 +413,10 @@ typedef struct _jl_code_instance_t {
410413
uint8_t nonoverlayed:1;
411414
} purity_flags;
412415
};
416+
#else
417+
uint32_t ipo_purity_bits;
418+
uint32_t purity_bits;
419+
#endif
413420
jl_value_t *argescapes; // escape information of call arguments
414421

415422
// compilation state cache

0 commit comments

Comments
 (0)