Skip to content

Don't use C99 syntax in for loop for smoother make #274

@7890

Description

@7890
diff --git a/source/src/BNFC/Backend/C/CFtoFlexC.hs b/source/src/BNFC/Backend/C/CFtoFlexC.hs
index 5f56765..85f7cc1 100644
--- a/source/src/BNFC/Backend/C/CFtoFlexC.hs
+++ b/source/src/BNFC/Backend/C/CFtoFlexC.hs
@@ -98,7 +98,8 @@ prelude name = unlines
    "{",
    "  loc->first_line = loc->last_line;",
    "  loc->first_column = loc->last_column;",
-   "  for (int i = 0; text[i] != '\\0'; ++i) {",
+   "  int i;",
+   "  for (i = 0; text[i] != '\\0'; ++i) {",
    "      if (text[i] == '\\n') {",
    "          ++loc->last_line;",
    "          loc->last_column = 0; ",

This helped to make without errors.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions