21495c
From 0c925491dea995ca96770159158bb8d57a48d84b Mon Sep 17 00:00:00 2001
21495c
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
21495c
Date: Wed, 15 Sep 2021 07:56:32 +0200
21495c
Subject: [PATCH] libexif/exif-gps-ifd.c: fix build with gcc 4.8
21495c
21495c
Fix the following build failure with gcc 4.8 raised since version 0.6.23 and
21495c
https://github.com/libexif/libexif/commit/e12c3529813cd16d50bf0a1c759093e1039dffec:
21495c
21495c
exif-gps-ifd.c: In function 'exif_get_gps_tag_info':
21495c
exif-gps-ifd.c:62:3: error: 'for' loop initial declarations are only allowed in C99 mode
21495c
   for (int i = 0; i < sizeof(exif_gps_ifd_tags) / sizeof(ExifGPSIfdTagInfo); ++i) {
21495c
   ^
21495c
exif-gps-ifd.c:62:3: note: use option -std=c99 or -std=gnu99 to compile your code
21495c
21495c
Fixes:
21495c
 - http://autobuild.buildroot.org/results/7dd222e06d1e6611449fb8fe7516817c9ad43d65
21495c
21495c
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
21495c
---
21495c
 libexif/exif-gps-ifd.c | 3 ++-
21495c
 1 file changed, 2 insertions(+), 1 deletion(-)
21495c
21495c
diff --git a/libexif/exif-gps-ifd.c b/libexif/exif-gps-ifd.c
21495c
index 9c9ba70..de5f950 100644
21495c
--- a/libexif/exif-gps-ifd.c
21495c
+++ b/libexif/exif-gps-ifd.c
21495c
@@ -59,7 +59,8 @@ const static struct ExifGPSIfdTagInfo exif_gps_ifd_tags[] = {
21495c
 };
21495c
 
21495c
 const ExifGPSIfdTagInfo *exif_get_gps_tag_info(ExifTag tag) {
21495c
-  for (int i = 0; i < sizeof(exif_gps_ifd_tags) / sizeof(ExifGPSIfdTagInfo); ++i) {
21495c
+  int i;
21495c
+  for (i = 0; i < sizeof(exif_gps_ifd_tags) / sizeof(ExifGPSIfdTagInfo); ++i) {
21495c
     if (tag==exif_gps_ifd_tags[i].tag)
21495c
       return &exif_gps_ifd_tags[i];
21495c
   }