[rtems commit] samples: Fix warnings

Sebastian Huber sebh at rtems.org
Tue Jul 24 08:07:16 UTC 2018


Module:    rtems
Branch:    master
Commit:    c192109f72d801464232988acc65ea5d4aa62348
Changeset: http://git.rtems.org/rtems/commit/?id=c192109f72d801464232988acc65ea5d4aa62348

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Jul 24 10:06:20 2018 +0200

samples: Fix warnings

---

 testsuites/samples/cdtest/main.cc  | 4 ++++
 testsuites/samples/loopback/init.c | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/testsuites/samples/cdtest/main.cc b/testsuites/samples/cdtest/main.cc
index 7aeb884..010bc22 100644
--- a/testsuites/samples/cdtest/main.cc
+++ b/testsuites/samples/cdtest/main.cc
@@ -89,6 +89,10 @@ public:
         check_end_of_test();
     };
 
+#if __cplusplus >= 201103L
+    AClass& operator=(const AClass&) = default;
+#endif
+
     virtual void print()  { printf("%s\n", string); };
 
 protected:
diff --git a/testsuites/samples/loopback/init.c b/testsuites/samples/loopback/init.c
index d537731..5cbbd54 100644
--- a/testsuites/samples/loopback/init.c
+++ b/testsuites/samples/loopback/init.c
@@ -100,7 +100,7 @@ static rtems_task workerTask(rtems_task_argument arg)
 {
     int s = arg;
     char msg[80];
-    char reply[100];
+    char reply[120];
     int i;
 
     for (;;) {
@@ -156,7 +156,7 @@ static rtems_task serverTask(rtems_task_argument arg)
             else
                 rtems_panic("Can't accept connection: %s", strerror(errno));
         else
-            printf("ACCEPTED:%lX\n", ntohl(farAddr.sin_addr.s_addr));
+            printf("ACCEPTED:%" PRIu32 "\n", ntohl(farAddr.sin_addr.s_addr));
         spawnTask(workerTask, myPriority, s1);
     }
 }




More information about the vc mailing list