Просмотр исходного кода

Remove warnings triggered on newer GCC (7.4.0)

Isaku Yamahata 5 лет назад
Родитель
Сommit
b3ddad0c37

+ 2 - 0
LibOS/shim/test/regression/getdents.c

@@ -2,7 +2,9 @@
 #include <fcntl.h>
 #include <inttypes.h>
 #include <stdio.h>
+#include <sys/stat.h>
 #include <sys/syscall.h>
+#include <unistd.h>
 
 struct linux_dirent {
     unsigned long   d_ino;

+ 1 - 0
Pal/src/host/FreeBSD/db_sockets.c

@@ -1380,6 +1380,7 @@ static int mcast_send (PAL_HANDLE handle, int offset, int size,
                 return -PAL_ERROR_CONNFAILED;
             case EAGAIN:
                 handle->hdr.flags &= ~WRITEABLE(1);
+                /* fallthrough */
             default:
                 return unix_to_pal_error(ERRNO(bytes));
         }

+ 1 - 1
Pal/src/host/Linux-SGX/debugger/sgx_gdb.c

@@ -325,7 +325,7 @@ int open_memdevice (pid_t pid, int * memdev, struct enclave_dbginfo ** ei)
     if (nmemdevs == sizeof(memdevs) / sizeof(memdevs[0]))
         return -ENOMEM;
 
-    struct enclave_dbginfo eib;
+    struct enclave_dbginfo eib = { .pid = -1 };
     long int res;
     for (int off = 0 ; off < sizeof(eib) ; off += sizeof(long int)) {
 

+ 1 - 0
Pal/src/host/Linux/db_sockets.c

@@ -1398,6 +1398,7 @@ static int64_t mcast_send (PAL_HANDLE handle, uint64_t offset, uint64_t size,
                 return -PAL_ERROR_CONNFAILED;
             case EAGAIN:
                 HANDLE_HDR(handle)->flags &= ~WRITEABLE(1);
+                /* fallthrough */
             default:
                 return unix_to_pal_error(ERRNO(bytes));
         }