X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=common.cc;h=42271221f32cb7012e868200769836d2ff383997;hb=d2cccdb33e7fb829b1c7541d79702665ca801424;hp=b57e93c7e3db3fb10bbb4564a9ecac65dd66feb9;hpb=44e8eabc8f7a0ab23c29037a770463d8a2de7b4a;p=satcheck.git diff --git a/common.cc b/common.cc index b57e93c..4227122 100644 --- a/common.cc +++ b/common.cc @@ -25,6 +25,7 @@ /** @brief Model-checker output file descriptor; default to stdout until redirected */ int model_out = STDOUT_FILENO; +int model_err = STDERR_FILENO; #define CONFIG_STACKTRACE /** Print a backtrace of the current program state. */ @@ -42,11 +43,11 @@ void print_trace(void) model_print("\nDumping stack trace (%d frames):\n", size); - for (i = 0; i < size; i++) + for (i = 0;i < size;i++) model_print("\t%s\n", strings[i]); free(strings); -#endif /* CONFIG_STACKTRACE */ +#endif/* CONFIG_STACKTRACE */ } void assert_hook(void) @@ -64,7 +65,7 @@ void model_assert(bool expr, const char *file, int line) #ifndef CONFIG_DEBUG -static int fd_user_out; /**< @brief File descriptor from which to read user program output */ +static int fd_user_out; /**< @brief File descriptor from which to read user program output */ /** * @brief Setup output redirecting @@ -146,7 +147,7 @@ void clear_program_output() { fflush(stdout); char buf[200]; - while (read_to_buf(fd_user_out, buf, sizeof(buf))); + while (read_to_buf(fd_user_out, buf, sizeof(buf))) ; } /** @brief Print out any pending program output */ @@ -177,4 +178,4 @@ void print_program_output() model_print("---- END PROGRAM OUTPUT ----\n"); } -#endif /* ! CONFIG_DEBUG */ +#endif/* ! CONFIG_DEBUG */