diff options
author | Ken Raeburn <raeburn@mit.edu> | 2009-02-05 02:16:22 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2009-02-05 02:16:22 +0000 |
commit | 1f423bd14f7bb42d1e594818598767810fe7f704 (patch) | |
tree | b3a4e31d12decb932543dfd1e0ddb8e4ac40fa5b /src/include | |
parent | 1705970a5aebaeb693fb5e074a7948ac4b03f7ef (diff) | |
download | krb5-1f423bd14f7bb42d1e594818598767810fe7f704.tar.gz krb5-1f423bd14f7bb42d1e594818598767810fe7f704.tar.xz krb5-1f423bd14f7bb42d1e594818598767810fe7f704.zip |
declare replacement [v]asprintf functions
If HAVE_VASPRINTF is not defined, make sure krb5int_{,v}asprintf
functions always get declared, applying the preprocessor conditional
test only to the GCC format attribute. If HAVE_VASPRINTF is defined,
don't declare them at all.
This fixes a bunch of function-not-declared warnings under Sun cc.
ticket: 6364
target_version: 1.7
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21888 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/k5-platform.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h index 23ddf69671..1734e42c1a 100644 --- a/src/include/k5-platform.h +++ b/src/include/k5-platform.h @@ -912,14 +912,18 @@ snprintf(char *str, size_t size, const char *format, ...) #endif /* win32? */ #endif /* no vsnprintf */ -#if !defined(__cplusplus) && (__GNUC__ > 2) +#ifndef HAVE_VASPRINTF + extern int krb5int_vasprintf(char **, const char *, va_list) - __attribute__((__format__(__printf__, 2, 0))); +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 2, 0))) +#endif + ; extern int krb5int_asprintf(char **, const char *, ...) - __attribute__((__format__(__printf__, 2, 3))); +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 2, 3))) #endif - -#ifndef HAVE_VASPRINTF + ; #define vasprintf krb5int_vasprintf /* Assume HAVE_ASPRINTF iff HAVE_VASPRINTF. */ |