From 9cacbc8cf4efdbc6715f2ddef399830682ad0ccf Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Fri, 1 Aug 2008 18:05:13 -0500 Subject: [PATCH] Remove uses of fprintf (stderr) that do not lead to an exit from the lib. --- source/cloog.c | 35 ++++++++++++++++++----------------- source/program.c | 53 +++++++++++++++++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 37 deletions(-) diff --git a/source/cloog.c b/source/cloog.c index 003c9e1..204c6aa 100644 --- a/source/cloog.c +++ b/source/cloog.c @@ -96,23 +96,24 @@ int main(int argv, char * argc[]) cloog_value_allocated,cloog_value_freed,cloog_value_max) ; } - /* Inform the user in case of a problem with the allocation statistics. */ - if ((cloog_matrix_allocated != cloog_matrix_freed) || - (cloog_domain_allocated != cloog_domain_freed) || - (cloog_loop_allocated != cloog_loop_freed) || - (cloog_statement_allocated != cloog_statement_freed) || - (cloog_block_allocated != cloog_block_freed) || - (cloog_value_allocated != cloog_value_freed)) - { fprintf(stderr, - "[CLooG]INFO: an internal problem has been detected (it should have" - " no\n consequence on the correctness of the output)." - " Please send (if\n you can) your input file, the first line " - "given by typing 'cloog -v'\n and your full command ") ; - fprintf(stderr, - "line call to CLooG including options to\n . Thank you for your participation to get\n" - " CLooG better and safer.\n") ; - } + /* Cloog should never print to stderr. */ + /* Inform the user in case of a problem with the allocation statistics. + if ((cloog_matrix_allocated != cloog_matrix_freed) || + (cloog_domain_allocated != cloog_domain_freed) || + (cloog_loop_allocated != cloog_loop_freed) || + (cloog_statement_allocated != cloog_statement_freed) || + (cloog_block_allocated != cloog_block_freed) || + (cloog_value_allocated != cloog_value_freed)) + { fprintf(stderr, + "[CLooG]INFO: an internal problem has been detected (it should have" + " no\n consequence on the correctness of the output)." + " Please send (if\n you can) your input file, the first line " + "given by typing 'cloog -v'\n and your full command ") ; + fprintf(stderr, + "line call to CLooG including options to\n . Thank you for your participation to get\n" + " CLooG better and safer.\n") ; + } */ cloog_options_free(options) ; cloog_finalize (); diff --git a/source/program.c b/source/program.c index 43c270a..ef7a3e2 100644 --- a/source/program.c +++ b/source/program.c @@ -513,7 +513,9 @@ CloogProgram * cloog_program_read(FILE * file, CloogOptions * options) if (scatteringl != NULL) { - if (cloog_domain_list_lazy_same(scatteringl)) + if (cloog_domain_list_lazy_same(scatteringl) + /* Cloog should never print to stderr. */ + && 0) fprintf(stderr, "[CLooG]WARNING: some scattering functions are " "similar.\n") ; @@ -630,9 +632,12 @@ CloogOptions * options ; #endif if (options->override) - { fprintf(stderr, - "[CLooG]WARNING: you are using -override option, be aware that the " - "generated\n code may be incorrect.\n") ; + { + /* Cloog should never print to stderr. */ + /* fprintf(stderr, + "[CLooG]WARNING: you are using -override option, be aware that the " + "generated\n code may be incorrect.\n") ; + */ } else { /* Playing with options may be dangerous, here are two possible issues : @@ -641,11 +646,14 @@ CloogOptions * options ; * it is the case, we set -l depth to the first acceptable value. */ if ((cloog_program_nb_scattdims (program) > options->l) && (options->l >= 0)) - { fprintf(stderr, - "[CLooG]WARNING: -l depth is less than the scattering dimension number " - "(the \n generated code may be incorrect), it has been " - "automaticaly set\n to this value (use option -override " - "to override).\n") ; + { + /* Cloog should never print to stderr. */ + /* fprintf(stderr, + "[CLooG]WARNING: -l depth is less than the scattering dimension number " + "(the \n generated code may be incorrect), it has been " + "automaticaly set\n to this value (use option -override " + "to override).\n") ; + */ options->l = cloog_program_nb_scattdims (program); } @@ -657,12 +665,15 @@ CloogOptions * options ; */ if (((options->f > 1) || (options->f < 0)) && ((options->l > cloog_program_nb_scattdims (program)) || (options->l < 0))) - { fprintf(stderr, - "[CLooG]WARNING: -f depth is more than one, -l depth has been " - "automaticaly set\n to the scattering dimension number " - "(target code may have\n duplicated iterations), -l depth " - "has been automaticaly set to\n this value (use option " - "-override to override).\n") ; + { + /* Cloog should never print to stderr. */ + /* fprintf(stderr, + "[CLooG]WARNING: -f depth is more than one, -l depth has been " + "automaticaly set\n to the scattering dimension number " + "(target code may have\n duplicated iterations), -l depth " + "has been automaticaly set to\n this value (use option " + "-override to override).\n") ; + */ options->l = cloog_program_nb_scattdims (program); } } @@ -833,8 +844,9 @@ void cloog_program_block(CloogProgram * program, CloogDomainList * scattering) free (scatt_reference) ; } - if (nb_blocked != 0) - fprintf(stderr, "[CLooG]INFO: %d domains have been blocked.\n",nb_blocked) ; + /* Cloog should never print to stderr. */ + /* if (nb_blocked != 0) + fprintf(stderr, "[CLooG]INFO: %d domains have been blocked.\n",nb_blocked) ; */ } @@ -954,9 +966,10 @@ CloogDomainList * scattering ; } } - if (nb_scaldims != 0) - fprintf(stderr, "[CLooG]INFO: %d dimensions (over %d) are scalar.\n", - nb_scaldims, cloog_program_nb_scattdims (program)) ; + /* Cloog should never print to stderr. */ + /* if (nb_scaldims != 0) + fprintf(stderr, "[CLooG]INFO: %d dimensions (over %d) are scalar.\n", + nb_scaldims, cloog_program_nb_scattdims (program)) ; */ } -- 2.11.4.GIT