[Test/bmp2png]: Fix -Werror errors after warnings level increase
authorXavier Roumegue <xavier.roumegue@nxp.com>
Thu, 19 Aug 2021 13:02:51 +0000 (13:02 +0000)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Fri, 20 Aug 2021 03:25:55 +0000 (12:25 +0900)
This fixes the following error, encountered with gcc 10.2:

| ../../../../../../workspace/sources/nnstreamer/tests/bmp2png.c: In function 'save_png_to_file':
| ../../../../../../workspace/sources/nnstreamer/tests/bmp2png.c:95:16: error: variable 'status' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
|    95 |   register int status = -1;
|       |                ^~~~~~
| cc1: all warnings being treated as errors

Signed-off-by: Xavier Roumegue <xavier.roumegue@nxp.com>
tests/bmp2png.c

index 157e8f4..be4bb2e 100644 (file)
@@ -127,6 +127,7 @@ save_png_to_file (bitmap_t * bitmap, const char *path)
   /** Set up error handling. */
 
   if (setjmp (png_jmpbuf (png_ptr))) {
+    status = -1;
     goto png_failure;
   }