diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-02-10 19:47:37 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-02-10 19:47:37 -0800 |
commit | ca55f514b6ee55c4ab6880bfa47d1c36967bd106 (patch) | |
tree | 81d450e4e364da386cd68d3afb521f0421214c0a | |
parent | 75de0f3d8b7bd9541a8a9528ab63e51fa9c57b17 (diff) |
Add additional printf & noreturn attributes suggested by gcc warnings
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | luit.h | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -30,17 +30,25 @@ extern int sevenbit; extern int ilog; extern int olog; -void child(char *, char *, char *const *); -void parent(int, int); - -void ErrorF(const char *f,...); - -/* Not using _X_NORETURN since that would pull in extra dependencies */ +/* Not using Xfuncproto.h since that would pull in extra dependencies */ #if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) -void FatalError(const char *f,...) __attribute((noreturn)); +# define LUIT_NORETURN __attribute__((noreturn)) #else -void FatalError(const char *f,...); +# define LUIT_NORETURN /* nothing */ +#endif + +#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203) +# define LUIT_PRINTF(x,y) __attribute__((__format__(__printf__,x,y))) +#else /* not gcc >= 2.3 */ +# define LUIT_PRINTF(x,y) /* nothing */ #endif +void child(char *, char *, char *const *) LUIT_NORETURN; +void parent(int, int); + +void ErrorF(const char *f,...) LUIT_PRINTF(1,2); + +void FatalError(const char *f,...) LUIT_NORETURN LUIT_PRINTF(1,2); + #endif /* LUIT_LUIT_H */ |