You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/04/26 09:22:54 UTC

[mynewt-core] branch master updated: sysview: Fix build for c++

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new b9cb3de  sysview: Fix build for c++
b9cb3de is described below

commit b9cb3de62a398b435fb97fe21eb12e20cf456677
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Tue Apr 20 11:41:47 2021 +0200

    sysview: Fix build for c++
    
    Initializing non-const char pointer with constant string literal
    is an error in c++ according to g++ compiler.
    error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
    
    This assignment even for c build is not useful since
    asprintf assigns new value (possible NULL) to desc anyway.
    
    This change just drops meaningless initialization that makes g++ unhappy.
---
 kernel/os/include/os/os_trace_api.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/os/include/os/os_trace_api.h b/kernel/os/include/os/os_trace_api.h
index 315463f..f84a178 100644
--- a/kernel/os/include/os/os_trace_api.h
+++ b/kernel/os/include/os/os_trace_api.h
@@ -68,7 +68,7 @@ static inline uint32_t
 os_trace_module_register(os_trace_module_t *m, const char *name,
                          uint32_t num_events, void (* send_desc_func)(void))
 {
-    char *desc = "M=???";
+    char *desc;
 
     asprintf(&desc, "M=%s", name);