Skip to content

Commit bae3043

Browse files
committed
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
1 parent 14bb439 commit bae3043

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

features/cellular/framework/AT/ATHandler.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "rtos/ThisThread.h"
2727
#include "Kernel.h"
2828
#include "CellularUtil.h"
29-
#include <stdarg.h>
3029
#include "SingletonPtr.h"
3130

3231
using namespace mbed;
@@ -1223,7 +1222,7 @@ void ATHandler::cmd_start(const char *cmd)
12231222
_cmd_start = true;
12241223
}
12251224

1226-
void ATHandler::handle_args(const char *format, va_list list)
1225+
void ATHandler::handle_args(const char *format, std::va_list list)
12271226
{
12281227
while (*format != '\0') {
12291228
if (*format == 'd') {

features/cellular/framework/AT/ATHandler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include "PlatformMutex.h"
2525
#include "nsapi_types.h"
2626

27-
#include "PlatformMutex.h"
2827
#include "Callback.h"
28+
2929
#include <cstdarg>
3030

3131
namespace mbed {
@@ -549,7 +549,7 @@ class ATHandler {
549549

550550
private:
551551
//Handles the arguments from given variadic list
552-
void handle_args(const char *format, va_list list);
552+
void handle_args(const char *format, std::va_list list);
553553

554554
//Starts an AT command based on given parameters
555555
void handle_start(const char *cmd, const char *cmd_chr);

0 commit comments

Comments
 (0)