From 7a8a3a35471f6357e403456783c4514c4f62dfa3 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 23 Nov 2018 14:04:46 +0200 Subject: [PATCH] Fix compiler warnings: clobber variables This patchs fixes warnings generated by older toolchains: shared/image-loader.c: In function 'load_png': shared/image-loader.c:211:12: warning: variable 'data' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] png_byte *data = NULL; See https://linux.die.net/man/3/longjmp why is this needed. Signed-off-by: Marius Vlad --- shared/image-loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/image-loader.c b/shared/image-loader.c index 14096816..8686e02a 100644 --- a/shared/image-loader.c +++ b/shared/image-loader.c @@ -208,8 +208,8 @@ load_png(FILE *fp) { png_struct *png; png_info *info; - png_byte *data = NULL; - png_byte **row_pointers = NULL; + png_byte *volatile data = NULL; + png_byte **volatile row_pointers = NULL; png_uint_32 width, height; int depth, color_type, interlace, stride; unsigned int i;