Skip to content

Commit ecb12fa

Browse files
committed
Add GCC printf formatting checks
1 parent 278334f commit ecb12fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Print.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ class Print
4444
void setWriteError(int err = 1) { write_error = err; }
4545
public:
4646
Print() : write_error(0) {}
47-
47+
4848
int getWriteError() { return write_error; }
4949
void clearWriteError() { setWriteError(0); }
50-
50+
5151
virtual size_t write(uint8_t) = 0;
5252
size_t write(const char *str) {
5353
if (str == NULL) return 0;
@@ -88,8 +88,8 @@ class Print
8888
size_t println(double, int = 2);
8989
size_t println(const Printable&);
9090
size_t println(void);
91-
92-
int16_t printf(const char *format, ...);
91+
92+
int16_t printf(const char *format, ...) __attribute__ ((format (printf, 2, 3)));
9393
int16_t printf(const __FlashStringHelper *format, ...);
9494
};
9595

0 commit comments

Comments
 (0)