All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Why do we typedef every struct on QEMU?
@ 2018-07-17 19:50 Eduardo Habkost
  2018-07-17 20:06 ` Peter Maydell
  0 siblings, 1 reply; 8+ messages in thread
From: Eduardo Habkost @ 2018-07-17 19:50 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé,
	Markus Armbruster, Dr. David Alan Gilbert, Paolo Bonzini,
	Peter Maydell

I have been looking at patches that touch typedefs.h and
wondering: why do we make typedefs.h necessary at all?  Why do we
always add typedefs for every struct and union type in QEMU?

Why do we prefer to write this:

----- qemu/typedefs.h:
typedef struct SomeType SomeType;
----------------------

----- qemu/somecode.h:
#include <qemu/typedefs.h>

int some_function(SomeType *a);
----------------------


...instead of simply writing this:?

----- qemu/somecode.h:
struct SomeType;
int some_function(struct SomeType *a);
----------------------

Is the maintenance burden of typedefs.h worth it?

-- 
Eduardo

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-07-27 13:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-17 19:50 [Qemu-devel] Why do we typedef every struct on QEMU? Eduardo Habkost
2018-07-17 20:06 ` Peter Maydell
2018-07-19  6:42   ` Markus Armbruster
2018-07-19  8:18     ` Thomas Huth
2018-07-19  8:28     ` Paolo Bonzini
2018-07-27 13:03     ` Stefan Hajnoczi
2018-07-27 13:14       ` Daniel P. Berrangé
2018-07-27 13:16       ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.