Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility with older gcc bug: unnamed union members cannot be used in init #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/c2.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ typedef struct _c2_l c2_l_t;
/// Pointer to a condition tree.
typedef struct {
bool isbranch : 1;
union {
c2_b_t *b;
c2_l_t *l;
};
#if _GNUC_ > 4 || ( _GNUC_ == 4 && _GNUC_MINOR_ >= 6 ) /// for compatibility with <gcc 4.2 o 4.3
union {
#endif
c2_b_t *b;
c2_l_t *l;
#if _GNUC_ > 4 || ( _GNUC_ == 4 && _GNUC_MINOR_ >= 6 )
};
#endif

} c2_ptr_t;

/// Initializer for c2_ptr_t.
Expand Down