You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2017/03/30 21:12:24 UTC

[07/37] incubator-mynewt-core git commit: MYNEWT-688; disabling unused-result warning when compiling hw/mcu/native, and assigning return value from write() in os_fault.c:__assert_func().

MYNEWT-688; disabling unused-result warning when compiling hw/mcu/native,
and assigning return value from write() in os_fault.c:__assert_func().


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/efbaf05f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/efbaf05f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/efbaf05f

Branch: refs/heads/nrf_cputime
Commit: efbaf05f414e4e4076334ab676c47a6f5a5235b9
Parents: e62a245
Author: System Administrator <ma...@runtime.io>
Authored: Tue Mar 28 15:29:09 2017 -0700
Committer: System Administrator <ma...@runtime.io>
Committed: Tue Mar 28 15:29:09 2017 -0700

----------------------------------------------------------------------
 hw/mcu/native/pkg.yml             | 3 +++
 kernel/os/src/arch/sim/os_fault.c | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/efbaf05f/hw/mcu/native/pkg.yml
----------------------------------------------------------------------
diff --git a/hw/mcu/native/pkg.yml b/hw/mcu/native/pkg.yml
index 7094340..79df5a7 100644
--- a/hw/mcu/native/pkg.yml
+++ b/hw/mcu/native/pkg.yml
@@ -31,3 +31,6 @@ pkg.deps:
 
 pkg.req_apis:
     - console
+
+pkg.cflags:
+    - -Wno-unused-result

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/efbaf05f/kernel/os/src/arch/sim/os_fault.c
----------------------------------------------------------------------
diff --git a/kernel/os/src/arch/sim/os_fault.c b/kernel/os/src/arch/sim/os_fault.c
index 964202e..92d7aa0 100644
--- a/kernel/os/src/arch/sim/os_fault.c
+++ b/kernel/os/src/arch/sim/os_fault.c
@@ -27,6 +27,7 @@ void
 __assert_func(const char *file, int line, const char *func, const char *e)
 {
     char msg[256];
+    int len;
 
     if (file) {
         snprintf(msg, sizeof(msg), "assert @ %s:%d\n", file, line);
@@ -34,6 +35,7 @@ __assert_func(const char *file, int line, const char *func, const char *e)
         snprintf(msg, sizeof(msg), "assert @ %p\n",
                  __builtin_return_address(0));
     }
-    write(1, msg, strlen(msg));
+    len = write(1, msg, strlen(msg));
+    (void)len;
     _exit(1);
 }