-
Notifications
You must be signed in to change notification settings - Fork 37
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
typedef and anonymous structs #8
Labels
Comments
I saw this myself when I was converting a header. I ended up having to pick the output apart myself and set the structs in the right way. |
I do know it's not optimal, but it should still work? |
Another case where the struct has a name but only appears in a typedef: typedef struct rd_kafka_metadata {
int broker_cnt; /* Number of brokers in 'brokers' */
struct rd_kafka_metadata_broker *brokers; /* Brokers */
int topic_cnt; /* Number of topics in 'topics' */
struct rd_kafka_metadata_topic *topics; /* Topics */
int32_t orig_broker_id; /* Broker originating this metadata */
char *orig_broker_name; /* Name of originating broker */
} rd_kafka_metadata_t;
rd_kafka_metadata (rd_kafka_t *rk, int all_topics,
rd_kafka_topic_t *only_rkt,
const struct rd_kafka_metadata **metadatap,
int timeout_ms); |
Isn't is already fixed? |
I don't know myself. Try the Pebble headers. That's what I was translating at the time. |
ciechowoj
added a commit
to ciechowoj/dstep
that referenced
this issue
Aug 30, 2016
ciechowoj
added a commit
to ciechowoj/dstep
that referenced
this issue
Aug 31, 2016
ciechowoj
added a commit
to ciechowoj/dstep
that referenced
this issue
Aug 31, 2016
ciechowoj
added a commit
to ciechowoj/dstep
that referenced
this issue
Aug 31, 2016
ciechowoj
added a commit
to ciechowoj/dstep
that referenced
this issue
Aug 31, 2016
ciechowoj
added a commit
to ciechowoj/dstep
that referenced
this issue
Aug 31, 2016
ciechowoj
added a commit
to ciechowoj/dstep
that referenced
this issue
Sep 4, 2016
ciechowoj
added a commit
to ciechowoj/dstep
that referenced
this issue
Sep 4, 2016
ciechowoj
added a commit
to ciechowoj/dstep
that referenced
this issue
Sep 8, 2016
ciechowoj
added a commit
to ciechowoj/dstep
that referenced
this issue
Sep 8, 2016
jacob-carlborg
added a commit
that referenced
this issue
Sep 25, 2016
Fix #8: Typedef and anonymous structs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something like this:
typedef struct { ... } struct_name;
is a common pattern in c. It's just a way to rename an anonymous struct.
dstep split this in two different declaration
struct anonymous
{
}
and
alias anonymous struct_name;
Original anonymous struct will be never used and can't be called from C code, so I think this two declaration can be merged in a single named struct.
The text was updated successfully, but these errors were encountered: