diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2009-01-08 19:13:52 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2009-01-08 19:13:52 +0000 |
commit | 302922f6852c65b9e6ea32d0d7295c789a02178d (patch) | |
tree | 2f64a4e22d4746635a84f575bbd350bf554cf94d /gpsd.h-tail | |
parent | 10897dfeebd5cb72304f137fb38c29d41b50912a (diff) | |
download | gpsd-302922f6852c65b9e6ea32d0d7295c789a02178d.tar.gz |
use some of GCC's attributes...
...to tell the compiler that gpsd_report is a printf-like function and
warn of mismatches between formats and arguments. from Sascha Wessel
Diffstat (limited to 'gpsd.h-tail')
-rw-r--r-- | gpsd.h-tail | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail index d06a10f8..2653ea83 100644 --- a/gpsd.h-tail +++ b/gpsd.h-tail @@ -433,7 +433,11 @@ extern gps_mask_t gpsd_poll(struct gps_device_t *); extern void gpsd_wrap(struct gps_device_t *); /* caller should supply this */ +# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +__attribute__((__format__(__printf__, 2, 3))) void gpsd_report(int, const char *, ...); +# else /* not a new enough GCC, use the unprotected prototype */ void gpsd_report(int, const char *, ...); +#endif #ifdef S_SPLINT_S extern bool finite(double); |