All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm] xf86drm: fix compile error for declare i in for loop
@ 2017-05-17  9:26 Qiang Yu
  2017-05-17 13:17 ` Emil Velikov
  0 siblings, 1 reply; 10+ messages in thread
From: Qiang Yu @ 2017-05-17  9:26 UTC (permalink / raw)
  To: dri-devel; +Cc: Qiang Yu

error log:
xf86drm.c: In function 'parse_separate_sysfs_files':
xf86drm.c:3104:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for (unsigned i = ignore_revision ? 1 : 0; i < ARRAY_SIZE(attrs); i++) {
     ^
xf86drm.c:3104:5: note: use option -std=c99 or -std=gnu99 to compile your code
make[4]: *** [libdrm_la-xf86drm.lo] Error 1

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
---
 xf86drm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xf86drm.c b/xf86drm.c
index 728ac78..dc028cc 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3100,8 +3100,9 @@ static int parse_separate_sysfs_files(int maj, int min,
     unsigned int data[ARRAY_SIZE(attrs)];
     FILE *fp;
     int ret;
+    unsigned i;
 
-    for (unsigned i = ignore_revision ? 1 : 0; i < ARRAY_SIZE(attrs); i++) {
+    for (i = ignore_revision ? 1 : 0; i < ARRAY_SIZE(attrs); i++) {
         snprintf(path, PATH_MAX, "/sys/dev/char/%d:%d/device/%s", maj, min,
                  attrs[i]);
         fp = fopen(path, "r");
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-05-18 15:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-17  9:26 [PATCH libdrm] xf86drm: fix compile error for declare i in for loop Qiang Yu
2017-05-17 13:17 ` Emil Velikov
2017-05-17 13:58   ` Yu, Qiang
2017-05-17 16:10     ` Emil Velikov
2017-05-17 18:02       ` Chih-Wei Huang
2017-05-17 18:16     ` Eric Engestrom
2017-05-18 11:10       ` Emil Velikov
2017-05-18 12:47         ` Eric Engestrom
2017-05-18 13:46           ` Emil Velikov
2017-05-18 15:07             ` Emil Velikov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.