Bug#914822: libwine:i386: missing printf output, without a printf failure
On 2018-11-27 18:59:26 +0100, Vincent Lefevre wrote:
> I do some tests of MPFR with MinGW, running the tests under wine
> (32-bit version). But sometimes, output from a printf is missing.
>
> The MPFR code (in tests/tversion.c) is the following:
>
> if (printf ("[tversion] MPFR %s\n", MPFR_VERSION_STRING) < 0)
> {
> perror ("tversion (first printf)");
> err = 1;
> }
>
> and at the end:
>
> return err;
>
> so that if printf fails, the test will fail. But this is not the
> case: the test succeeds, even though output is missing, as shown
> by a diff on the generated file:
[...]
I forgot to say that output is not buffered:
setbuf (stdout, NULL);
setbuf (stderr, NULL);
from the tests_start_mpfr function (tests.c), called before the first
printf.
Just in case, there is also a test of errno at the end:
if (errno != 0)
{
perror ("tversion");
err = 1;
}
It is also possible that the output occurred but was lost via the
script (e.g. in the pipe), but this would still be a bug.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Reply to: