[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [creduce-dev] reduction using dynamic information

On 2016-07-12 08:36, John Regehr wrote:

I have two small tweaks to suggest. We should print the value only
once (or else we might get a lot of output for an expression that
lives in a loop) and we should make the value easy to recognize in
case the program prints other stuff.  So perhaps:

  { int tmp1 = expr1;
    static int _creduce_printed = 0;
    if (!_creduce_printed) {
      printf("creduce_value(%d)\n", tmp1);
      _creduce_printed = 1;
    x = foo(tmp1, expr2);}

Also we'll have to add a prototype for printf() to the compilation
unit or maybe it's better to simply include stdio.h.

Got it. Thanks for the suggestion.

- Yang