[Lldb-commits] [PATCH] Use the right type for pid_t on FreeBSD

Davide Italiano davide at freebsd.org
Fri Mar 20 18:20:51 PDT 2015


Just for the records, it's uint64_t as defined in lldb_types.h. pid_t is int32_t at least on FreeBSD and Mac OS (didn't check Linux).  Also, clang complains about signed vs unsigned comparison:

../tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp:973:49: warning: comparison of integers of different signs: 'lldb::pid_t' (aka 'unsigned long') and 'int' [-Wsign-compare]

  if ((pid = terminal.Fork(err_str, err_len)) == -1)
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^  ~~

so actually this change make the logic correct in case fork() fails and therefore returns -1 to the parent.


http://reviews.llvm.org/D8491

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list