summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-11-22 14:34:03 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-11-22 14:34:03 +0300
commit1cac788521d8de382b0c976cfc8ea2ad1cd59f34 (patch)
tree370d80520cefe5dc31f2094b3a4e9497611d511f /os_dep.c
parent225f8070477fd6f4766ea05c2444aa48bee22899 (diff)
downloadbdwgc-1cac788521d8de382b0c976cfc8ea2ad1cd59f34.tar.gz
Workaround 'nonlocal var will use ptr to local var' cppcheck false positive
* extra/msvc_dbg.c (sym_namebuf_u): New union type. * extra/msvc_dbg.c (GetSymbolNameFromAddress): Use sym_namebuf_u instead of anonymous union. * os_dep.c [MPROTECT_VDB && DARWIN] (mp_reply_s, mp_msg_s): Move struct type definition out of GC_mprotect_thread (adding mp_ prefix).
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/os_dep.c b/os_dep.c
index 026aaf64..85fa3150 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -4022,21 +4022,25 @@ typedef enum {
# define GC_mprotect_state GC_MP_NORMAL
#endif /* !THREADS */
+struct mp_reply_s {
+ mach_msg_header_t head;
+ char data[256];
+};
+
+struct mp_msg_s {
+ mach_msg_header_t head;
+ mach_msg_body_t msgh_body;
+ char data[1024];
+};
+
STATIC void *GC_mprotect_thread(void *arg)
{
mach_msg_return_t r;
/* These two structures contain some private kernel data. We don't */
/* need to access any of it so we don't bother defining a proper */
/* struct. The correct definitions are in the xnu source code. */
- struct reply_s {
- mach_msg_header_t head;
- char data[256];
- } reply;
- struct msg_s {
- mach_msg_header_t head;
- mach_msg_body_t msgh_body;
- char data[1024];
- } msg;
+ struct mp_reply_s reply;
+ struct mp_msg_s msg;
mach_msg_id_t id;
if ((word)arg == GC_WORD_MAX) return 0; /* to prevent a compiler warning */