pramsey / pgsql-ogr-fdw

PostgreSQL foreign data wrapper for OGR
MIT License
237 stars 34 forks source link

c99 fix #200

Closed Drethic closed 3 years ago

Drethic commented 3 years ago

When running make install on Oracle Linux 9.6 the following error happens:

ogr_fdw_func.c: In function ‘ogr_fdw_drivers’:
ogr_fdw_func.c:55:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < num_drivers; i++) {
  ^
ogr_fdw_func.c:55:2: note: use option -std=c99 or -std=gnu99 to compile your code

ogr_fdw_info.c:33:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for (int i = 0; i < strlen(str); i++) {
   ^
ogr_fdw_info.c:33:3: note: use option -std=c99 or -std=gnu99 to compile your code

ogr_fdw_info.c:425:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < sizeof(reserved)/sizeof(reserved[0]); i++)
  ^
ogr_fdw_info.c:425:2: note: use option -std=c99 or -std=gnu99 to compile your code

I updated all 3 for loops to have int i; declared before the loops in ogr_fdw_func.c and ogr_fdw_info.c and removed int from each loops expression.