From: Paul Eggert Date: Tue, 5 Apr 2011 20:06:52 +0000 (-0700) Subject: * image.c (tiff_error_handler, tiff_warning_handler): Mark as X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~394^2~10 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5e2d4a30b2a30631701f8645cf4f626c7c765569;p=emacs.git * image.c (tiff_error_handler, tiff_warning_handler): Mark as printf-like functions. (tiff_load): Add casts to remove these marks before passing them to system-supplied API. --- diff --git a/src/ChangeLog b/src/ChangeLog index 45eee781589..3f2837d52f0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,6 +2,11 @@ Fix more problems found by GCC 4.6.0's static checks. + * image.c (tiff_error_handler, tiff_warning_handler): Mark as + printf-like functions. + (tiff_load): Add casts to remove these marks before passing them + to system-supplied API. + * eval.c (Fsignal): Remove excess argument to 'fatal'. * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int. diff --git a/src/image.c b/src/image.c index 45bd590e415..260bc6eb260 100644 --- a/src/image.c +++ b/src/image.c @@ -6714,6 +6714,8 @@ tiff_size_of_memory (thandle_t data) } +static void tiff_error_handler (const char *, const char *, va_list) + ATTRIBUTE_FORMAT_PRINTF (2, 0); static void tiff_error_handler (const char *title, const char *format, va_list ap) { @@ -6726,6 +6728,8 @@ tiff_error_handler (const char *title, const char *format, va_list ap) } +static void tiff_warning_handler (const char *, const char *, va_list) + ATTRIBUTE_FORMAT_PRINTF (2, 0); static void tiff_warning_handler (const char *title, const char *format, va_list ap) { @@ -6757,8 +6761,8 @@ tiff_load (struct frame *f, struct image *img) specified_file = image_spec_value (img->spec, QCfile, NULL); specified_data = image_spec_value (img->spec, QCdata, NULL); - fn_TIFFSetErrorHandler (tiff_error_handler); - fn_TIFFSetWarningHandler (tiff_warning_handler); + fn_TIFFSetErrorHandler ((TIFFErrorHandler) tiff_error_handler); + fn_TIFFSetWarningHandler ((TIFFErrorHandler) tiff_warning_handler); if (NILP (specified_data)) {