(main): Flush stdout and and check for errors prior to termination;
end with call to exit rather than return from main, as with gen*.c.
From-SVN: r6078
printf ("0");
printf ("}},\n");
}
+
+ fflush (stdout);
+ exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
+ /* NOTREACHED */
return 0;
}
if (!tmp)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes);
- exit (1);
+ exit (FATAL_EXIT_CODE);
}
return tmp;
else
fprintf (stderr, "(Number of opcodes is %d)\n", i);
+ fflush (stdout);
+ exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
+ /* NOTREACHED */
return 0;
}
if (!tmp)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes);
- exit (1);
+ exit (FATAL_EXIT_CODE);
}
return tmp;
for (d = defs; d; d = d->next)
for (v = d->variations; v; v = v->next)
printf("\"%s%s\",\n", d->basename, v->name);
+
+ fflush (stdout);
+ exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
+ /* NOTREACHED */
return 0;
}
if (!tmp)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes);
- exit (1);
+ exit (FATAL_EXIT_CODE);
}
return tmp;