Browse Source

Get rid of some compiler warnings

Caleb James DeLisle 3 years ago
parent
commit
b5a8365497
3 changed files with 8 additions and 2 deletions
  1. 1 1
      exception/Er.c
  2. 6 0
      net/TUNAdapter.c
  3. 1 1
      node_build/make.js

+ 1 - 1
exception/Er.c

@@ -59,5 +59,5 @@ struct Er_Ret* Er__raise(char* file, int line, struct Allocator* alloc, char* fo
 void Er__assertFail(struct Er_Ret* er)
 {
     if (!er) { return; }
-    Assert_failure(er->message);
+    Assert_failure("%s", er->message);
 }

+ 6 - 0
net/TUNAdapter.c

@@ -85,7 +85,10 @@ static Iface_DEFUN incomingFromTunIf(struct Message* msg, struct Iface* tunIf)
     }
 
     // first move the dest addr to the right place.
+    #pragma GCC diagnostic push
+    #pragma GCC diagnostic ignored "-Wfortify-source"
     Bits_memmove(header->destinationAddr - DataHeader_SIZE, header->destinationAddr, 16);
+    #pragma GCC diagnostic pop
 
     Er_assert(Message_eshift(msg, DataHeader_SIZE + RouteHeader_SIZE - Headers_IP6Header_SIZE));
     struct RouteHeader* rh = (struct RouteHeader*) msg->msgbytes;
@@ -130,7 +133,10 @@ static Iface_DEFUN incomingFromUpperDistributorIf(struct Message* msg,
     Assert_true(type <= ContentType_IP6_MAX);
 
     // Shift ip address into destination slot.
+    #pragma GCC diagnostic push
+    #pragma GCC diagnostic ignored "-Wfortify-source"
     Bits_memmove(hdr->ip6 + DataHeader_SIZE - 16, hdr->ip6, 16);
+    #pragma GCC diagnostic pop
     // put my address as destination.
     Bits_memcpy(&hdr->ip6[DataHeader_SIZE], ud->myIp6, 16);
 

+ 1 - 1
node_build/make.js

@@ -130,7 +130,7 @@ Builder.configure({
             // a case of if (1 == 1)
             '-Wno-tautological-compare',
 
-            '-Wno-error'
+            //'-Wno-error'
         );
         builder.config.cflags.slice(builder.config.cflags.indexOf('-Werror'), 1);
     } else {