Visva92 / seccompsandbox

Automatically exported from code.google.com/p/seccompsandbox
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Build error with GCC 4.6 on x64 #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When building with GCC 4.6 on x64, the following build error appears for a 
number of files:

In file included from seccompsandbox/syscall_table.h:18:0,
                 from seccompsandbox/sandbox_impl.h:51,
                 from seccompsandbox/debug.h:14,
                 from seccompsandbox/ioctl.cc:5:
seccompsandbox/securemem.h: In static member function ‘static void 
playground::SecureMem::sendSystemCall(const 
playground::SecureMem::SyscallRequestInfo&, playground::SecureMem::LockType, 
T1, T2, T3) [with T1 = int, T2 = int, T3 = void*]’:
seccompsandbox/ioctl.cc:39:61:   instantiated from here
seccompsandbox/securemem.h:180:5: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]
seccompsandbox/securemem.h:180:5: error: cast to pointer from integer of 
different size [-Werror=int-to-pointer-cast]

This warning was added to GCC 4.6 as part of 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28584

Original issue reported on code.google.com by rsleevi@chromium.org on 5 Jun 2011 at 8:20

GoogleCodeExporter commented 8 years ago

Original comment by rsleevi@chromium.org on 2 Jul 2011 at 11:14

GoogleCodeExporter commented 8 years ago
I think, this is a bogus warning that we just need to turn off for the seccomp 
sandbox. But I don't know in detail what GCC 4.6 does here, and whether there 
might be some subtle new optimizations compared to earlier versions of GCC. So, 
I feel a little hesitant to start inserting #pragma statements into the code. 
Can somebody who know GCC better please provide some guidance?

Original comment by mar...@google.com on 5 Jul 2011 at 7:53

GoogleCodeExporter commented 8 years ago
I've tried to make a fix of these warnings, please take a look at 
http://codereview.chromium.org/7326013/ I've replaced all warning-prone C-casts 
with reinterpret_casts and have added const_cast in some places. Also have 
removed a few unused variables.

Original comment by pph...@gmail.com on 8 Jul 2011 at 1:31

GoogleCodeExporter commented 8 years ago

Original comment by zod...@gmail.com on 16 Sep 2011 at 6:45