The main thing I dislike about typedefs is that you can't forward declare them.
If I know for sure I'm never going to need to do that then OK.
If I know for sure I'm never going to need to do that then OK.
typedef struct foo foo;
and somewhere else
struct foo { … }
typedef struct bla_s { ... } bla_t;
Now you have a struct named 'bla_s' and a type alias 'bla_t'. For the forward declaration you'd use 'bla_s'.Using the same name also works just fine, since structs and type aliases live in different namespaces:
typedef struct bla_t { ... } bla_t;
...also before that topic comes up again: the _t postfix is not reserved in the C standard :) struct _GtkLabel;
typedef struct _GtkLabel GtkLabel;
// Use GtkLabel* in declarations typedef struct GtkLabel GtkLabel;
works just fine.https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel....