From a6b95836287e68a05afdc5db9664e942ab2b2543 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 21 Jan 2010 15:58:18 +0100 Subject: [PATCH] [lbtt] Kill some warnings on Ubuntu. * src/UserCommandReader.cc (UserCommandInterface): Explicitly ignore the return code of system() to kill a warning. * src/TestOperations.cc (generateBuchiAutomaton): Explicitly ignore the return code of write() to kill a warning. --- lbtt/ChangeLog | 9 +++++++++ lbtt/src/TestOperations.cc | 28 ++++++++++++++-------------- lbtt/src/UserCommandReader.cc | 10 +++++----- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/lbtt/ChangeLog b/lbtt/ChangeLog index d1c94f0f9..749b0343e 100644 --- a/lbtt/ChangeLog +++ b/lbtt/ChangeLog @@ -1,3 +1,12 @@ +2010-01-21 Alexandre Duret-Lutz + + Kill some warnings on Ubuntu. + + * src/UserCommandReader.cc (UserCommandInterface): Explicitly + ignore the return code of system() to kill a warning. + * src/TestOperations.cc (generateBuchiAutomaton): Explicitly + ignore the return code of write() to kill a warning. + 2010-01-16 Guillaume Sadegh Add a missing include. diff --git a/lbtt/src/TestOperations.cc b/lbtt/src/TestOperations.cc index 01e41b2a2..e2560313e 100644 --- a/lbtt/src/TestOperations.cc +++ b/lbtt/src/TestOperations.cc @@ -288,7 +288,7 @@ void printFileContents first_line_printed = true; estream << string(indent, ' ') + message + '\n'; } - + estream << string(indent, ' ') + line_prefix + message_line + '\n'; } } @@ -400,7 +400,7 @@ void generateStateSpace() 2, 6); } - else + else { current_size = configuration.statespace_generator.min_size; printText("[All state spaces have been enumerated. Staring over]\n", @@ -488,7 +488,7 @@ void generateStateSpace() printText(" ok\n", 4); - if (configuration.statespace_generator.max_size + if (configuration.statespace_generator.max_size > configuration.statespace_generator.min_size) printText("number of states: " + toString(round_info.statespace->size()) @@ -653,7 +653,7 @@ void generateFormulae(istream* formula_input_stream) if (printText(" ok\n", 4)) printText("", 4, 6); - + round_info.formulae[3] = &(::Ltl::Not::construct(*round_info.formulae[2])); if (printText(" ok\n", 4)) @@ -941,8 +941,8 @@ void generateBuchiAutomaton /* setsid, dup2 or exec failed: write the value of errno to * error_pipe */ - write(error_pipe[1], static_cast(&errno), - sizeof(int)); + (void) write(error_pipe[1], static_cast(&errno), + sizeof(int)); close(error_pipe[1]); exit(0); @@ -1027,7 +1027,7 @@ void generateBuchiAutomaton times(&timing_information_end); translator_process = 0; - /* + /* * If there is something to be read from error_pipe, then there * was an error in replacing the child process with the external * program (and the pipe contains the value of errno in this @@ -1199,7 +1199,7 @@ void generateBuchiAutomaton printText("[User break]", 1, configuration.global_options.verbosity <= 2 ? 0 : 10); printText("\n\n", 1); - + if (round_info.transcript_file.is_open()) writeToTranscript("User break while generating Büchi automaton (" + configuration.algorithmString(algorithm_id) @@ -1347,7 +1347,7 @@ void generateBuchiAutomaton += automaton_stats.number_of_buchi_transitions; final_statistics[algorithm_id].total_number_of_acceptance_sets[f] += automaton_stats.number_of_acceptance_sets; - + if (final_statistics[algorithm_id].total_buchi_generation_time[f] < 0.0 || automaton_stats.buchi_generation_time < 0.0) final_statistics[algorithm_id].total_buchi_generation_time[f] = -1.0; @@ -1415,10 +1415,10 @@ void performEmptinessCheck product_stats = product.globalEmptinessCheck (automaton_stats.buchi_automaton->initialState(), automaton_stats.emptiness_check_result, - round_info.real_emptiness_check_size); + round_info.real_emptiness_check_size); printText(" ok\n", 4); - + automaton_stats.number_of_product_states = product_stats.first; automaton_stats.number_of_product_transitions = product_stats.second; @@ -1450,7 +1450,7 @@ void performEmptinessCheck printText("[User break]", 1, configuration.global_options.verbosity <= 2 ? 0 : 10); printText("\n\n", 1); - + if (round_info.transcript_file.is_open()) writeToTranscript("User break while generating product automaton (" + configuration.algorithmString(algorithm_id) @@ -1558,10 +1558,10 @@ void performConsistencyCheck } printText((result ? " ok\n" : " failed\n"), 4); - + if (configuration.global_options.verbosity >= 2) printConsistencyCheckStats(cout, 8, algorithm_id); -} +} /* ========================================================================= */ void compareResults() diff --git a/lbtt/src/UserCommandReader.cc b/lbtt/src/UserCommandReader.cc index 051c56306..b6ee0ddf0 100644 --- a/lbtt/src/UserCommandReader.cc +++ b/lbtt/src/UserCommandReader.cc @@ -207,7 +207,7 @@ void executeUserCommands() round_info.cout << '\n'; round_info.cout.flush(); } - + if (!input_tokens.empty()) { token = parseCommand(input_tokens[0]); @@ -221,7 +221,7 @@ void executeUserCommands() rounds_to_continue = (input_tokens.size() > 1 ? parseNumber(input_tokens[1]) : 1); - + if (rounds_to_continue == 0) throw CommandErrorException("Argument of the command must be " "positive."); @@ -320,7 +320,7 @@ void executeUserCommands() "the current test round was skipped."); /* - * If the command expects a formula identifier as a parameter, + * If the command expects a formula identifier as a parameter, * determine the type of the formula to which the command refers. */ @@ -536,7 +536,7 @@ void executeUserCommands() } else if (!external_command.empty()) { - system(external_command.c_str()); + (void) system(external_command.c_str()); round_info.cout << '\n'; round_info.cout.flush(); } @@ -825,7 +825,7 @@ pair parseRedirection(vector& input_tokens) /* ---------------------------------------------------------------------------- * * Description: Tests whether the last argument to a user command specifies - * output redirection. If redirection is requested, the + * output redirection. If redirection is requested, the * "argument" specifying the redirection is removed from the * vector of strings forming the command. *