I am trying build ESP8266 MQTT demo within Keil uvision 4 as well as in GCC-ARM-Embedded.
According to GCC, attribute deprecated is kind of warning, but it is error in Keil and it stops me from building binary code.
mbed/platform/Callback.h(1298): error: #1204: attribute "deprecated" does not take arguments
MBED_DEPRECATED_SINCE("mbed-os-5.1",
I have checked the source code of toolchain.h
toolchain.h
#ifndef MBED_DEPRECATED
#if defined(__GNUC__) || defined(__clang__)
#define MBED_DEPRECATED(M) __attribute__((deprecated(M)))
#elif defined(__CC_ARM)
#define MBED_DEPRECATED(M) __attribute__((deprecated))
#else
#define MBED_DEPRECATED(M)
#endif
#endif
#define MBED_DEPRECATED_SINCE(D, M) MBED_DEPRECATED(M " [since " D "]")
The error comes come following code:
callback.h
template <typename T>
MBED_DEPRECATED_SINCE("mbed-os-5.1",
"Arguments to callback have been reordered to attach(func, arg)")
void attach(const T *obj, R (*func)(const T*, A0)) {
this->~Callback();
new (this) Callback(func, obj);
}
I changed MBED_DEPRECATED_SINCE() in one line like this:
code in one line
MBED_DEPRECATED_SINCE("mbed-os-5.1", "Arguments to callback have been reordered to attach(func, arg)")
It doesn't help at all.
new error
mbed/platform/Callback.h(1312): error: #1204: attribute "deprecated" does not take arguments
MBED_DEPRECATED_SINCE("mbed-os-5.1", "Arguments to callback have been reordered to attach(func, arg)")
What's wrong with that code ?
I am trying build ESP8266 MQTT demo within Keil uvision 4 as well as in GCC-ARM-Embedded.
According to GCC, attribute deprecated is kind of warning, but it is error in Keil and it stops me from building binary code.
I have checked the source code of toolchain.h
toolchain.h
The error comes come following code:
callback.h
I changed MBED_DEPRECATED_SINCE() in one line like this:
code in one line
It doesn't help at all.
new error
What's wrong with that code ?