[Lldb-commits] [lldb] r280755 - Reorder FreeBSD Host.cpp #includes to fix build

Dimitry Andric via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 6 15:05:33 PDT 2016


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.

-Dimitry

> On 07 Sep 2016, at 00:02, Zachary Turner via lldb-commits <lldb-commits at lists.llvm.org> wrote:
> 
> 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?
> 
> On Tue, Sep 6, 2016 at 2:33 PM Ed Maste via lldb-commits <lldb-commits at lists.llvm.org <mailto:lldb-commits at lists.llvm.org>> wrote:
> Author: emaste
> Date: Tue Sep  6 16:25:31 2016
> New Revision: 280755
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=280755&view=rev <http://llvm.org/viewvc/llvm-project?rev=280755&view=rev>
> Log:
> Reorder FreeBSD Host.cpp #includes to fix build
> 
> Modified:
>     lldb/trunk/source/Host/freebsd/Host.cpp
> 
> Modified: lldb/trunk/source/Host/freebsd/Host.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=280755&r1=280754&r2=280755&view=diff <http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=280755&r1=280754&r2=280755&view=diff>
> ==============================================================================
> --- lldb/trunk/source/Host/freebsd/Host.cpp (original)
> +++ lldb/trunk/source/Host/freebsd/Host.cpp Tue Sep  6 16:25:31 2016
> @@ -9,17 +9,19 @@
>  //===----------------------------------------------------------------------===//
> 
>  // C Includes
> -#include <dlfcn.h>
> -#include <execinfo.h>
> -#include <stdio.h>
> +#include <sys/types.h>
> +
> +#include <sys/exec.h>
>  #include <sys/proc.h>
> +#include <sys/ptrace.h>
>  #include <sys/sysctl.h>
> -#include <sys/types.h>
>  #include <sys/user.h>
> 
>  #include <machine/elf.h>
> -#include <sys/exec.h>
> -#include <sys/ptrace.h>
> +
> +#include <dlfcn.h>
> +#include <execinfo.h>
> +#include <stdio.h>
> 
>  // C++ Includes
>  // Other libraries and framework includes
> 
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org <mailto:lldb-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160907/01ef6b6c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160907/01ef6b6c/attachment.sig>


More information about the lldb-commits mailing list