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 <cstdarg>. 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 <stdarg.h>" which is kind of duplicate of
"#include <cstdarg>".

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 *, <error-type>)"  (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 *, <error-type>)"  (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
pull/10900/head
Tero Jääskö 2019-06-26 17:12:04 +03:00
parent 14bb4399b3
commit bae3043e92
2 changed files with 3 additions and 4 deletions

View File

@ -26,7 +26,6 @@
#include "rtos/ThisThread.h"
#include "Kernel.h"
#include "CellularUtil.h"
#include <stdarg.h>
#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') {

View File

@ -24,8 +24,8 @@
#include "PlatformMutex.h"
#include "nsapi_types.h"
#include "PlatformMutex.h"
#include "Callback.h"
#include <cstdarg>
namespace mbed {
@ -549,7 +549,7 @@ private:
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);