X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Finttostr.h;h=a103caf587f1a4966888bc6aed4a983d34b4b194;hb=56093e4d947bcc87bbc05ac3e8645509274f57b4;hp=aa5820fd5af33a0af04e82f646b5f62107d53447;hpb=57fdfd3f8ec62b105c53bcdf6f127c35c7fe7391;p=gnulib.git diff --git a/lib/inttostr.h b/lib/inttostr.h index aa5820fd5..a103caf58 100644 --- a/lib/inttostr.h +++ b/lib/inttostr.h @@ -23,7 +23,24 @@ #include "intprops.h" -char *offtostr (off_t, char *); -char *imaxtostr (intmax_t, char *); -char *umaxtostr (uintmax_t, char *); -char *uinttostr (unsigned int, char *); +#ifndef __GNUC_PREREQ +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +# else +# define __GNUC_PREREQ(maj, min) 0 +# endif +#endif + +#if __GNUC_PREREQ (3,4) +# undef __attribute_warn_unused_result__ +# define __attribute_warn_unused_result__ \ + __attribute__ ((__warn_unused_result__)) +#else +# define __attribute_warn_unused_result__ /* empty */ +#endif + +char *offtostr (off_t, char *) __attribute_warn_unused_result__; +char *imaxtostr (intmax_t, char *) __attribute_warn_unused_result__; +char *umaxtostr (uintmax_t, char *) __attribute_warn_unused_result__; +char *uinttostr (unsigned int, char *) __attribute_warn_unused_result__;