From 14bb4399b3728e0d70e2c41c930605bb53134d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tero=20J=C3=A4=C3=A4sk=C3=B6?= Date: Wed, 26 Jun 2019 16:54:12 +0300 Subject: [PATCH 1/2] nanostack: silence compiler warnings for implicit virtual call_in ARMCC reminds of the missing virtual declaration of call_in in the Nanostack.h. Warnings silenced: ---8<---8<--- Compile [ 52.3%]: LoWPANNDInterface.cpp [Warning] Nanostack.h@278,0: #1300-D: call_in inherits implicit virtual Compile [ 52.4%]: NanostackEMACInterface.cpp [Warning] Nanostack.h@278,0: #1300-D: call_in inherits implicit virtual Compile [ 52.5%]: MeshInterfaceNanostack.cpp [Warning] Nanostack.h@278,0: #1300-D: call_in inherits implicit virtual Compile [ 52.6%]: NanostackEthernetInterface.cpp [Warning] Nanostack.h@278,0: #1300-D: call_in inherits implicit virtual Compile [ 52.7%]: ThreadInterface.cpp [Warning] Nanostack.h@278,0: #1300-D: call_in inherits implicit virtual ompile [ 53.0%]: WisunInterface.cpp [Warning] Nanostack.h@278,0: #1300-D: call_in inherits implicit virtual --- features/nanostack/nanostack-interface/Nanostack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/nanostack/nanostack-interface/Nanostack.h b/features/nanostack/nanostack-interface/Nanostack.h index 495a679510c..a074af42832 100644 --- a/features/nanostack/nanostack-interface/Nanostack.h +++ b/features/nanostack/nanostack-interface/Nanostack.h @@ -275,7 +275,7 @@ class Nanostack : public OnboardNetworkStack, private mbed::NonCopyable func); + virtual nsapi_error_t call_in(int delay, mbed::Callback func); struct nanostack_callback { mbed::Callback callback; From bae3043e92e9b8810d2168ae50c4d36b4433c6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tero=20J=C3=A4=C3=A4sk=C3=B6?= Date: Wed, 26 Jun 2019 17:12:04 +0300 Subject: [PATCH 2/2] cellular: AT: fix build on ARMCC5 ARMC5 failed to compile the code with debug-profile (!!) as va_list is getting into std:: namespace when one includes . Other compilers seem to be more relaxed, and so is ARMC5 if compiled with other profiles. Add the explicit std:: to references of va_list. While here, remove one extra copy of "#include "PlatformMutex.h"" and a "#include " which is kind of duplicate of "#include ". Error being fixed: --8<--8<--8<-- Compile [ 81.8%]: ATHandler.cpp [Error] ATHandler.h@552,0: #20: identifier "va_list" is undefined [Error] ATHandler.cpp@1226,0: #147: declaration is incompatible with "void mbed::ATHandler::handle_args(const char *, )" (declared at line 552 of "./mbed-os/features/cellular/framework/AT/ATHandler.h") [ERROR] "./mbed-os/features/cellular/framework/AT/ATHandler.h", line 552: Error: #20: identifier "va_list" is undefined "./mbed-os/features/cellular/framework/AT/ATHandler.cpp", line 1226: Error: #147: declaration is incompatible with "void mbed::ATHandler::handle_args(const char *, )" (declared at line 552 of "./mbed-os/features/cellular/framework/AT/ATHandler.h") ./mbed-os/features/cellular/framework/AT/ATHandler.cpp: 0 warnings, 2 errors --- features/cellular/framework/AT/ATHandler.cpp | 3 +-- features/cellular/framework/AT/ATHandler.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/features/cellular/framework/AT/ATHandler.cpp b/features/cellular/framework/AT/ATHandler.cpp index e89e445e0c5..d016415a966 100644 --- a/features/cellular/framework/AT/ATHandler.cpp +++ b/features/cellular/framework/AT/ATHandler.cpp @@ -26,7 +26,6 @@ #include "rtos/ThisThread.h" #include "Kernel.h" #include "CellularUtil.h" -#include #include "SingletonPtr.h" using namespace mbed; @@ -1223,7 +1222,7 @@ void ATHandler::cmd_start(const char *cmd) _cmd_start = true; } -void ATHandler::handle_args(const char *format, va_list list) +void ATHandler::handle_args(const char *format, std::va_list list) { while (*format != '\0') { if (*format == 'd') { diff --git a/features/cellular/framework/AT/ATHandler.h b/features/cellular/framework/AT/ATHandler.h index 13f4e955ed3..c05c581c0c5 100644 --- a/features/cellular/framework/AT/ATHandler.h +++ b/features/cellular/framework/AT/ATHandler.h @@ -24,8 +24,8 @@ #include "PlatformMutex.h" #include "nsapi_types.h" -#include "PlatformMutex.h" #include "Callback.h" + #include namespace mbed { @@ -549,7 +549,7 @@ class ATHandler { private: //Handles the arguments from given variadic list - void handle_args(const char *format, va_list list); + void handle_args(const char *format, std::va_list list); //Starts an AT command based on given parameters void handle_start(const char *cmd, const char *cmd_chr);