Skip to content

Commit 1c1c5eb

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 82ce311 commit 1c1c5eb

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

src/julia.h

+2-20
Original file line numberDiff line numberDiff line change
@@ -390,26 +390,8 @@ typedef struct _jl_code_instance_t {
390390
//TODO: uint8_t absolute_max; // whether true max world is unknown
391391

392392
// purity results
393-
union {
394-
uint32_t ipo_purity_bits;
395-
struct {
396-
uint8_t ipo_consistent:2;
397-
uint8_t ipo_effect_free:2;
398-
uint8_t ipo_nothrow:2;
399-
uint8_t ipo_terminates:2;
400-
uint8_t ipo_nonoverlayed:1;
401-
} ipo_purity_flags;
402-
};
403-
union {
404-
uint32_t purity_bits;
405-
struct {
406-
uint8_t consistent:2;
407-
uint8_t effect_free:2;
408-
uint8_t nothrow:2;
409-
uint8_t terminates:2;
410-
uint8_t nonoverlayed:1;
411-
} purity_flags;
412-
};
393+
uint32_t ipo_purity_bits;
394+
uint32_t purity_bits;
413395
jl_value_t *argescapes; // escape information of call arguments
414396

415397
// compilation state cache

0 commit comments

Comments
 (0)