[lldb-dev] SIG values in driver\Platform.h

Zachary Turner zturner at google.com
Sat May 24 22:56:10 PDT 2014


I'm working on cleaning getting rid of all warnings durings a Windows build
(there are currently thousands), and I've found something unusual in
tools\driver\Platform.h.  _INC_SIGNAL is explicitly defined with a comment
indicating that the purpose is so that signal.h is not included, and then
specific values from signal.h are defined.

My first question is why not just include signal.h?  Since there is a
comment here it's clearly intentional, so I'd like to understand the
reasoning before just removing this and including signal.h. I thought maybe
it was because some compilers on Windows supported signal.h and others
didn't, but then in Platform.cpp there is a comment that says "this file is
only relevant for Visual C++".  So that's not it either.

My second question is regarding the values of some of the constants.
 Specifically, these:

    #define SIG_DFL ( (sighandler_t) -1 )
    #define SIG_IGN ( (sighandler_t) -2 )

    #define SIGCONT  18
    #define SIGTSTP  20

These are actually not the correct values.  SIG_DFL is 0, SIG_IGN is 1,
SIGCONT is 19, and SIGTSTP is 18.  Can I assume this is a bug?   Note that,
again, simply including signal.h would fix this, so this goes back to my
first question about the reasoning behind not including it.

Thanks,
Zach
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140524/5f53570f/attachment.html>


More information about the lldb-dev mailing list