Commit 4625f3ad authored by Seblu's avatar Seblu

fix compilation issue with current version of gcc

parent 8f2e81ab
......@@ -63,8 +63,8 @@ void ast_cmd_print(s_ast_node *node, FILE *fs, unsigned int *node_id)
size_t last = 0, p = 0;
for (; prefix[i][p]; ++p)
if (prefix[i][p] == '"')
fprintf(fs, "%.*s\\", p - last, prefix[i] + last), last = p;
fprintf(fs, "%*s", p - last, prefix[i] + last), last = p;
fprintf(fs, "%.*s\\", (int) (p - last), prefix[i] + last), last = p;
fprintf(fs, "%*s", (int) (p - last), prefix[i] + last), last = p;
fprintf(fs, "\\n");
}
}
......@@ -76,8 +76,8 @@ void ast_cmd_print(s_ast_node *node, FILE *fs, unsigned int *node_id)
size_t last = 0, p = 0;
for (; argv[i][p]; ++p)
if (argv[i][p] == '"')
fprintf(fs, "%.*s\\", p - last, argv[i] + last), last = p;
fprintf(fs, "%*s", p - last, argv[i] + last), last = p;
fprintf(fs, "%.*s\\", (int) (p - last), argv[i] + last), last = p;
fprintf(fs, "%*s", (int) (p - last), argv[i] + last), last = p;
fprintf(fs, "\\n");
}
fprintf(fs, "\"];\n");
......
......@@ -39,7 +39,7 @@ void ast_for_print(s_ast_node *node, FILE *fs, unsigned *node_id)
fprintf(fs, "%u [ label = \"Values\\n", *node_id);
++*node_id;
for (register size_t i = 0; node->body.child_for.values[i]; ++i)
fprintf(fs, "id=%u %s\\n", i, node->body.child_for.values[i]);
fprintf(fs, "id=%zu %s\\n", i, node->body.child_for.values[i]);
fprintf(fs, "\"];");
}
//execution
......
......@@ -53,7 +53,7 @@ void ast_red_print(s_ast_node *node, FILE *fs, unsigned *node_id)
fprintf(fs, "%u [label = \"Redirection\\n", *node_id);
++*node_id;
for (register size_t i = 0; i < reds->size; ++i)
fprintf(fs, "id=%d, fd=%d, type=%d, word=%s\\n",
fprintf(fs, "id=%zu, fd=%d, type=%d, word=%s\\n",
i, reds->fd[i], reds->type[i], reds->word[i]);
fprintf(fs, "\"];\n");
fprintf(fs, "%u -> %u\n", cur_id, *node_id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment