[PATCH] lib: Fix compiler error in lirc_options.c

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] lib: Fix compiler error in lirc_options.c

Joshua Henderson
irc_options.c  -fPIC -DPIC -o .libs/lirc_options.o
lirc_options.c: In function 'parse_O_arg':
lirc_options.c:88:2: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
  for (int i = 0; i < argc; i += 1) {
  ^
lirc_options.c:88:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
make[3]: *** [lirc_options.lo] Error 1

Signed-off-by: Joshua Henderson <[hidden email]>
---
 lib/lirc_options.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/lirc_options.c b/lib/lirc_options.c
index cd29ceb..e024ec3 100644
--- a/lib/lirc_options.c
+++ b/lib/lirc_options.c
@@ -84,8 +84,9 @@ static const struct option o_option[] = {
 static char* parse_O_arg(int argc, char** argv)
 {
  char* path = NULL;
+ int i;
 
- for (int i = 0; i < argc; i += 1) {
+ for (i = 0; i < argc; i += 1) {
  if (strcmp(argv[i], "-O") != 0 &&
     strcmp(argv[i], "--options-file") != 0)
  continue;
--
1.7.9.5


------------------------------------------------------------------------------
Loading...