Skip to content

Commit e37df85

Browse files
Warn when Serial.printf() format is wrong
Let GCC check the format string to Print::printf()
1 parent d955d75 commit e37df85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: api/Print.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ class Print
9090
size_t println(void);
9191

9292
// EFP3 - Add printf() to make life so much easier...
93-
size_t printf(const char *format, ...);
94-
size_t printf_P(const char *format, ...);
93+
size_t printf(const char *format, ...) __attribute__ ((format (printf, 2, 3)));
94+
size_t printf_P(const char *format, ...) __attribute__ ((format (printf, 2, 3)));
9595

9696
virtual void flush() { /* Empty implementation for backward compatibility */ }
9797
};

0 commit comments

Comments
 (0)