Skip to content

Commit 3da44f6

Browse files
committed
Add format checking to RawSerial::printf
1 parent fc32d95 commit 3da44f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/RawSerial.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#if defined (DEVICE_SERIAL) || defined(DOXYGEN_ONLY)
2222

23+
#include "mbed_toolchain.h"
2324
#include "drivers/SerialBase.h"
2425
#include "hal/serial_api.h"
2526
#include "platform/NonCopyable.h"
@@ -86,7 +87,7 @@ class RawSerial: public SerialBase, private NonCopyable<RawSerial> {
8687
*/
8788
int puts(const char *str);
8889

89-
int printf(const char *format, ...);
90+
int printf(const char *format, ...) MBED_PRINTF_METHOD(1, 2);
9091

9192
#if !(DOXYGEN_ONLY)
9293
protected:

0 commit comments

Comments
 (0)