[Spice-devel] [PATCH 1/2] unify header include order

Christophe Fergeau cfergeau at redhat.com
Thu May 12 07:22:08 UTC 2016


On Wed, May 11, 2016 at 12:25:00PM -0400, Frediano Ziglio wrote:
> > 
> > On Tue, May 10, 2016 at 02:23:04PM +0100, Frediano Ziglio wrote:
> > > Use this style for include headers inside headers:
> > > 
> > >   #include <system_headers.h>
> > >   #include <no_spice_no_system_libraries.h>
> > >   #include <spice_protocol.h>
> > >   #include <spice_common.h>
> > > 
> > >   #include "spice_server.h"
> > 
> > I would add that to this coding style document if it's not already
> > there. I tend to prefer when the headers are alphabetically ordered
> > within a given section (probably not worth changing throughout the
> > codebase now, but could be nice to keep an eye on that when adding new
> > #includes)
> > 
> 
> I think the alphabetical order is a bit too strict.
> Also for experience some - even system - headers needs to
> be included before some others just to avoid bugs (first I
> remember is windows.h and winsock2.h but even HP-UX and
> others systems, I remember one nasty problem with a stdarg.h).

I'm not suggesting a strict enforcement of this, but when adding new
#includes, I think it would be nicer to try to get some kind of order ;)

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160512/c1023865/attachment.sig>


More information about the Spice-devel mailing list