The following patch corrects some function attributes. (#61780)

The following patch corrects some function attributes. (#61780)

        * glib/ghash.h (g_int_equal, g_int_hash): These are not const.

        * glib/glibintl.h (_glib_gettext): Add G_GNUC_FORMAT(1).

        * glib/gmacros.h: Use reserved symbols in function attribute macros.

        The following patch avoids manual printf()-format parsing
        if a C99-conforming vsnprintf() is available. (#55106)

        * acinclude.m4 (AC_FUNC_VSNPRINTF_C99): New macro to test for a
        C99 conforming vsnprintf.

        * configure.in: Use AC_FUNC_VSNPRINTF_C99.

        * glib/gmessages.c (g_printf_string_upper_bound): Use C99 vsnprintf().
This commit is contained in:
Matthias Clasen
2001-12-06 22:37:05 +00:00
parent 964ebaf18c
commit 39e4c5afe8
14 changed files with 238 additions and 11 deletions

View File

@@ -56,19 +56,19 @@
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define G_GNUC_PRINTF( format_idx, arg_idx ) \
__attribute__((format (printf, format_idx, arg_idx)))
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
#define G_GNUC_SCANF( format_idx, arg_idx ) \
__attribute__((format (scanf, format_idx, arg_idx)))
__attribute__((__format__ (__scanf__, format_idx, arg_idx)))
#define G_GNUC_FORMAT( arg_idx ) \
__attribute__((format_arg (arg_idx)))
__attribute__((__format_arg__ (arg_idx)))
#define G_GNUC_NORETURN \
__attribute__((noreturn))
__attribute__((__noreturn__))
#define G_GNUC_CONST \
__attribute__((const))
__attribute__((__const__))
#define G_GNUC_UNUSED \
__attribute__((unused))
__attribute__((__unused__))
#define G_GNUC_NO_INSTRUMENT \
__attribute__((no_instrument_function))
__attribute__((__no_instrument_function__))
#else /* !__GNUC__ */
#define G_GNUC_PRINTF( format_idx, arg_idx )
#define G_GNUC_SCANF( format_idx, arg_idx )