Changes to VT:
Fixed compiler warning with the Clang compiler (no previous prototype for function '__fprintf_chk') This commit was SVN r31143.
Этот коммит содержится в:
родитель
9314e9f0a3
Коммит
cc3dd86121
@ -42,13 +42,7 @@ AC_DEFUN([ACVT_IOWRAP],
|
||||
fdatasync \
|
||||
lockf])
|
||||
|
||||
AC_CHECK_FUNCS([__fprintf_chk],
|
||||
[
|
||||
dnl Check whether <stdio.h> declares __vfprintf_chk. This should be the case if
|
||||
dnl _FORTIFY_SOURCE is defined (default when using the GNU compiler).
|
||||
dnl Otherwise, we have to declare this function to avoid compiler warnings.
|
||||
AC_CHECK_DECLS([__vfprintf_chk], [], [], [#include <stdio.h>])
|
||||
])
|
||||
AC_CHECK_DECLS([__fprintf_chk], [], [], [#include <stdio.h>])
|
||||
|
||||
CPPFLAGS=$sav_CPPFLAGS
|
||||
|
||||
|
@ -1477,14 +1477,11 @@ int fscanf(FILE *stream, const char *format, ...)
|
||||
}
|
||||
|
||||
|
||||
#if defined(HAVE___FPRINTF_CHK) && HAVE___FPRINTF_CHK
|
||||
#if !(defined(HAVE_DECL___VFPRINTF_CHK) && HAVE_DECL___VFPRINTF_CHK)
|
||||
extern int __vfprintf_chk(FILE *stream, int flag, const char *format, va_list ap);
|
||||
#endif /* HAVE_DECL___VFPRINTF_CHK */
|
||||
#if defined(HAVE_DECL___FPRINTF_CHK) && HAVE_DECL___FPRINTF_CHK
|
||||
int __fprintf_chk(FILE *stream, int flag, const char *format, ...)
|
||||
#else /* HAVE___FPRINTF_CHK */
|
||||
#else /* HAVE_DECL___FPRINTF_CHK */
|
||||
int fprintf(FILE *stream, const char *format, ...)
|
||||
#endif /* HAVE___FPRINTF_CHK */
|
||||
#endif /* HAVE_DECL___FPRINTF_CHK */
|
||||
{
|
||||
#define VT_IOWRAP_THISFUNCNAME fprintf
|
||||
int ret;
|
||||
@ -1502,11 +1499,11 @@ int fprintf(FILE *stream, const char *format, ...)
|
||||
|
||||
vt_cntl_msg(DBG_IO, "vfprintf");
|
||||
va_start (arg, format);
|
||||
#if defined(HAVE___FPRINTF_CHK) && HAVE___FPRINTF_CHK
|
||||
#if defined(HAVE_DECL___FPRINTF_CHK) && HAVE_DECL___FPRINTF_CHK
|
||||
ret = __vfprintf_chk(stream, flag, format, arg);
|
||||
#else /* HAVE___FPRINTF_CHK */
|
||||
#else /* HAVE_DECL___FPRINTF_CHK */
|
||||
ret = vfprintf(stream, format, arg);
|
||||
#endif /* HAVE___FPRINTF_CHK */
|
||||
#endif /* HAVE_DECL___FPRINTF_CHK */
|
||||
va_end (arg);
|
||||
|
||||
num_bytes = (ssize_t)ret;
|
||||
@ -1517,11 +1514,11 @@ int fprintf(FILE *stream, const char *format, ...)
|
||||
}
|
||||
else {
|
||||
va_start (arg, format);
|
||||
#if defined(HAVE___FPRINTF_CHK) && HAVE___FPRINTF_CHK
|
||||
#if defined(HAVE_DECL___FPRINTF_CHK) && HAVE_DECL___FPRINTF_CHK
|
||||
ret = __vfprintf_chk(stream, flag, format, arg);
|
||||
#else /* HAVE___FPRINTF_CHK */
|
||||
#else /* HAVE_DECL___FPRINTF_CHK */
|
||||
ret = vfprintf(stream, format, arg);
|
||||
#endif /* HAVE___FPRINTF_CHK */
|
||||
#endif /* HAVE_DECL___FPRINTF_CHK */
|
||||
va_end (arg);
|
||||
return ret;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user