<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Yeah, sorry, I meant ScriptInterpreterPython.h.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">What Matt is suggesting is certainly easier, and probably harmless, but it violates the rule against only including what’s necessary.  Maybe we could go with
 Matt’s change as a short term fix to get the build clean and set a long term goal of cleaning things up in a better way.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-Andy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Enrico Granata [mailto:egranata@apple.com]
<br>
<b>Sent:</b> Thursday, November 29, 2012 5:16 PM<br>
<b>To:</b> Kaylor, Andrew<br>
<b>Cc:</b> Kopec, Matt; lldb-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [Lldb-commits] fixing build warnings on Linux<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I don't think ScriptInterpreter.h includes Python.h<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">ScriptInterpreterPython.h does - at a glance the main reasons for that are:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> our ScriptInterpreterPythonObject is inlined in the .h file and uses Py_X*REF(x)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> our Locker class uses a PyGILState_STATE as a member variable<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> the ScriptInterpreterPython itself defines several PyObject* member variables<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">We would have to look into working around these dependencies (and maybe others I failed to see) before removing the #include of Python.h<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Incidentally, none of them seem insurmountable<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"><i>Enrico Granata</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Mincho"">✉</span> <a href="mailto:egranata@.com">
egranata@.com</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Mincho"">✆</span> (408) 972-7683<o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Nov 29, 2012, at 5:07 PM, "Kaylor, Andrew" <<a href="mailto:andrew.kaylor@intel.com">andrew.kaylor@intel.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">It looked to me like a whole lot of these were coming because ScriptInterpreterPython.h was being included somewhere deep in an include chain from places that probably didn't need Python at all.  I wondered if there was a way to avoid including
 Python.h from ScriptInterpreter.h and only bring it in when it was needed.<br>
<br>
-Andy<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:lldb-commits-bounces@cs.uiuc.edu">lldb-commits-bounces@cs.uiuc.edu</a> [mailto:lldb-<a href="mailto:commits-bounces@cs.uiuc.edu">commits-bounces@cs.uiuc.edu</a>] On Behalf Of Kopec, Matt<br>
Sent: Thursday, November 29, 2012 2:05 PM<br>
To: <a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
Subject: Re: [Lldb-commits] fixing build warnings on Linux<br>
<br>
Moving on, another warning popping up many times:<br>
<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/lldb.cpp:13:<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/../include/lldb/Core/Debugger.h:26:<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/../include/lldb/Core/FormatManager.h:21:<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/../include/lldb/Core/FormatNavigator.h:24:<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/../include/lldb/Core/FormatClasses.h:28:<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/../include/lldb/Interpreter/ScriptInterpreterPython.h:23:<br>
In file included from /usr/include/python2.7/Python.h:8:<br>
/usr/include/python2.7/pyconfig.h:1158:9: warning: '_POSIX_C_SOURCE' macro redefined #define _POSIX_C_SOURCE 200112L<br>
       ^<br>
/usr/include/features.h:163:10: note: previous definition is here<br>
# define _POSIX_C_SOURCE        200809L<br>
        ^<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/lldb.cpp:13:<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/../include/lldb/Core/Debugger.h:26:<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/../include/lldb/Core/FormatManager.h:21:<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/../include/lldb/Core/FormatNavigator.h:24:<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/../include/lldb/Core/FormatClasses.h:28:<br>
In file included from /home/mkopec1/dev/llvm/tools/lldb/source/../include/lldb/Interpreter/ScriptInterpreterPython.h:23:<br>
In file included from /usr/include/python2.7/Python.h:8:<br>
/usr/include/python2.7/pyconfig.h:1180:9: warning: '_XOPEN_SOURCE' macro redefined #define _XOPEN_SOURCE 600<br>
       ^<br>
/usr/include/features.h:165:10: note: previous definition is here # define _XOPEN_SOURCE  700<br>
<br>
<br>
<br>
From Python documentation (<a href="http://docs.python.org/3.1/c-api/intro.html#include-files">http://docs.python.org/3.1/c-api/intro.html#include-files</a>):<br>
<br>
Since Python may define some pre-processor definitions which affect the standard headers on some systems, you must include Python.h before any standard headers are included.<br>
<br>
<br>
<br>
I suggest adding a new header (include/lldb/lldb-python.h) and including it at the top of each source file producing this warning. The header source would look like this:<br>
<br>
<br>
#ifndef LLDB_lldb_python_h_<br>
#define LLDB_lldb_python_h_<br>
<br>
// Python.h needs to be included before any system headers in order to avoid redefinition of macros<br>
<br>
#ifdef LLDB_DISABLE_PYTHON<br>
<br>
// Python is disabled in this build<br>
<br>
#else<br>
<br>
#if defined (__APPLE__)<br>
#include <Python/Python.h><br>
#else<br>
#include <Python.h><br>
#endif<br>
<br>
#endif // LLDB_DISABLE_PYTHON<br>
<br>
#endif  // LLDB_lldb_python_h_<br>
<br>
<br>
Thoughts?<br>
________________________________________<br>
From: <a href="mailto:lldb-commits-bounces@cs.uiuc.edu">lldb-commits-bounces@cs.uiuc.edu</a> [<a href="mailto:lldb-commits-bounces@cs.uiuc.edu">lldb-commits-bounces@cs.uiuc.edu</a>] on behalf of Kopec, Matt [<a href="mailto:matt.kopec@intel.com">matt.kopec@intel.com</a>]<br>
Sent: Thursday, November 29, 2012 3:23 PM<br>
To: Greg Clayton<br>
Cc: <a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
Subject: Re: [Lldb-commits] fixing build warnings on Linux<br>
<br>
Yes, these do exist. Initially, I will replace the warning cases. Thanks :) ________________________________________<br>
From: Greg Clayton [<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>]<br>
Sent: Wednesday, November 28, 2012 4:32 PM<br>
To: Kopec, Matt<br>
Cc: <a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
Subject: Re: [Lldb-commits] fixing build warnings on Linux<br>
<br>
On Nov 28, 2012, at 12:58 PM, "Kopec, Matt" <<a href="mailto:matt.kopec@intel.com">matt.kopec@intel.com</a>> wrote:<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">Hi all,<br>
<br>
On Linux, there are hundreds of build warnings and I've taken steps to resolve them. Our goal is to be able to build trunk with -Werror.  Some warnings appear so often a patch would be painful to review. For these cases, I'll start with a category of warnings
 and a general solution on how to resolve for all instances.<br>
<br>
Printf format placeholder warnings:<br>
<br>
/home/mkopec1/dev/llvm/tools/lldb/source/API/SBBreakpoint.cpp:482:97: warning: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Wformat]<br>
      log->Printf ("SBBreakpoint(%p)::GetNumResolvedLocations () => %llu", m_opaque_sp.get(), (uint64_t)num_resolved);<br>
                                                                                                                       ~~~                                     ^~~~~~~~~~~~~~~<br>
<br>
%lu<br>
<br>
On Mac OS X, uint64_t is unsigned long long but on Linux (and FreeBSD) may be unsigned long or unsigned long long. Using the macros in inttypes.h will use the correct format placeholder.<br>
<br>
<br>
-         log->Printf ("SBBreakpoint(%p)::GetNumResolvedLocations () => %llu", m_opaque_sp.get(), (uint64_t)num_resolved);<br>
+        log->Printf ("SBBreakpoint(%p)::GetNumResolvedLocations () => <br>
+ %" PRIu64, m_opaque_sp.get(), (uint64_t)num_resolved);<br>
<br>
Does this seem reasonable?<o:p></o:p></p>
<p class="MsoNormal"><br>
Yes, as long asthere are PRI macros for all formats ('i', 'u', 'x', 'o', etc).<br>
<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>