From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffVza-0001Av-27 for qemu-devel@nongnu.org; Tue, 17 Jul 2018 15:50:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffVzV-0000HO-5o for qemu-devel@nongnu.org; Tue, 17 Jul 2018 15:50:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57198) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ffVzU-0000FK-V6 for qemu-devel@nongnu.org; Tue, 17 Jul 2018 15:50:33 -0400 Date: Tue, 17 Jul 2018 16:50:28 -0300 From: Eduardo Habkost Message-ID: <20180717195028.GA6691@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] Why do we typedef every struct on QEMU? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= , 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 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