<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>On NetBSD /usr/share/misc/style says:</div>

<div> </div>

<div>
<div>/*<br/>
 * Kernel include files come first.<br/>
 */<br/>
#include <sys/param.h>          /* <sys/param.h> first, */<br/>
#include <sys/types.h>          /*   <sys/types.h> next, */<br/>
#include <sys/ioctl.h>          /*   and then the rest, */<br/>
#include <sys/socket.h>         /*   sorted lexicographically.  */<br/>
#include <sys/stat.h><br/>
#include <sys/wait.h>           /* Non-local includes in brackets.  */</div>

<div>/*<br/>
 * If it's a network program, put the network include files next.<br/>
 * Group the includes files by subdirectory.<br/>
 */<br/>
#include <net/if.h><br/>
#include <net/if_dl.h><br/>
#include <net/route.h><br/>
#include <netinet/in.h><br/>
#include <protocols/rwhod.h></div>

<div>/*<br/>
 * Then there's a blank line, followed by the /usr include files.<br/>
 * The /usr include files should be sorted lexicographically!<br/>
 */<br/>
#include <assert.h><br/>
#include <errno.h><br/>
#include <inttypes.h><br/>
#include <stdio.h><br/>
#include <stdlib.h></div>

<div>/*<br/>
 * Global pathnames are defined in /usr/include/paths.h.  Pathnames local<br/>
 * to the program go in pathnames.h in the local directory.<br/>
 */<br/>
#include <paths.h></div>

<div>/* Then, there's a blank line, and the user include files. */<br/>
#include "pathnames.h"          /* Local includes in double quotes. */</div>

<div> </div>

<div>While the order of standard C headers can be pretty arbitrary, the system ones shall be included in the above order.</div>
</div>

<div>
<div>It's crucial for <sys/param.h> and <sys/types.h> to be on a top as other headers may assume that they were</div>

<div>already included.</div>

<div> </div>

<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Sent:</b> Wednesday, September 07, 2016 at 12:05 AM<br/>
<b>From:</b> "Dimitry Andric via lldb-commits" <lldb-commits@lists.llvm.org><br/>
<b>To:</b> "Zachary Turner" <zturner@google.com><br/>
<b>Cc:</b> lldb-commits@lists.llvm.org<br/>
<b>Subject:</b> Re: [Lldb-commits] [lldb] r280755 - Reorder FreeBSD Host.cpp #includes to fix build</div>

<div name="quoted-content">
<div>
<div>In general, <sys/*> and <machine/*> headers should be at the top, followed by standard headers such as <stdio.h>, then followed by application-specific headers.  IIRC this is also the case for Linux.</div>

<div> </div>

<div>-Dimitry</div>
 

<div>
<blockquote>
<div>On 07 Sep 2016, at 00:02, Zachary Turner via lldb-commits <<a href="lldb-commits@lists.llvm.org" target="_parent">lldb-commits@lists.llvm.org</a>> wrote:</div>
 

<div>
<div>Why was this causing a problem?  The only headers that were re-ordered are system headers.  Does FreeBSD's libraries have requirements about certain headers being included before other headers?</div>
 

<div class="gmail_quote">
<div>On Tue, Sep 6, 2016 at 2:33 PM Ed Maste via lldb-commits <<a href="lldb-commits@lists.llvm.org" target="_parent">lldb-commits@lists.llvm.org</a>> wrote:</div>

<blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;">Author: emaste<br class="gmail_msg"/>
Date: Tue Sep  6 16:25:31 2016<br class="gmail_msg"/>
New Revision: 280755<br class="gmail_msg"/>
<br class="gmail_msg"/>
URL: <a class="gmail_msg" href="http://llvm.org/viewvc/llvm-project?rev=280755&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=280755&view=rev</a><br class="gmail_msg"/>
Log:<br class="gmail_msg"/>
Reorder FreeBSD Host.cpp #includes to fix build<br class="gmail_msg"/>
<br class="gmail_msg"/>
Modified:<br class="gmail_msg"/>
    lldb/trunk/source/Host/freebsd/Host.cpp<br class="gmail_msg"/>
<br class="gmail_msg"/>
Modified: lldb/trunk/source/Host/freebsd/Host.cpp<br class="gmail_msg"/>
URL: <a class="gmail_msg" href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=280755&r1=280754&r2=280755&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=280755&r1=280754&r2=280755&view=diff</a><br class="gmail_msg"/>
==============================================================================<br class="gmail_msg"/>
--- lldb/trunk/source/Host/freebsd/Host.cpp (original)<br class="gmail_msg"/>
+++ lldb/trunk/source/Host/freebsd/Host.cpp Tue Sep  6 16:25:31 2016<br class="gmail_msg"/>
@@ -9,17 +9,19 @@<br class="gmail_msg"/>
 //===----------------------------------------------------------------------===//<br class="gmail_msg"/>
<br class="gmail_msg"/>
 // C Includes<br class="gmail_msg"/>
-#include <dlfcn.h><br class="gmail_msg"/>
-#include <execinfo.h><br class="gmail_msg"/>
-#include <stdio.h><br class="gmail_msg"/>
+#include <sys/types.h><br class="gmail_msg"/>
+<br class="gmail_msg"/>
+#include <sys/exec.h><br class="gmail_msg"/>
 #include <sys/proc.h><br class="gmail_msg"/>
+#include <sys/ptrace.h><br class="gmail_msg"/>
 #include <sys/sysctl.h><br class="gmail_msg"/>
-#include <sys/types.h><br class="gmail_msg"/>
 #include <sys/user.h><br class="gmail_msg"/>
<br class="gmail_msg"/>
 #include <machine/elf.h><br class="gmail_msg"/>
-#include <sys/exec.h><br class="gmail_msg"/>
-#include <sys/ptrace.h><br class="gmail_msg"/>
+<br class="gmail_msg"/>
+#include <dlfcn.h><br class="gmail_msg"/>
+#include <execinfo.h><br class="gmail_msg"/>
+#include <stdio.h><br class="gmail_msg"/>
<br class="gmail_msg"/>
 // C++ Includes<br class="gmail_msg"/>
 // Other libraries and framework includes<br class="gmail_msg"/>
<br class="gmail_msg"/>
<br class="gmail_msg"/>
_______________________________________________<br class="gmail_msg"/>
lldb-commits mailing list<br class="gmail_msg"/>
<a class="gmail_msg" href="lldb-commits@lists.llvm.org" target="_parent">lldb-commits@lists.llvm.org</a><br class="gmail_msg"/>
<a class="gmail_msg" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a></blockquote>
</div>
_______________________________________________<br/>
lldb-commits mailing list<br/>
<a href="lldb-commits@lists.llvm.org" target="_parent">lldb-commits@lists.llvm.org</a><br/>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a></div>
</blockquote>
</div>
<br/>
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a></div>
</div>
</div>
</div></div></body></html>