From 6822f7a99cc0f1dd49c3a4965f3eea6693ee4b72 Mon Sep 17 00:00:00 2001 From: vlefevre Date: Tue, 14 Sep 2021 14:03:49 +0000 Subject: [src/inp_str.c] Added a FIXME on a deprecated use of ungetc. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14579 280ebfd0-de03-0410-8827-d642c229c3f4 --- src/inp_str.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/inp_str.c b/src/inp_str.c index 676255480..a725cc19b 100644 --- a/src/inp_str.c +++ b/src/inp_str.c @@ -73,6 +73,10 @@ mpfr_inp_str (mpfr_ptr rop, FILE *stream, int base, mpfr_rnd_t rnd_mode) break; c = getc (stream); } + /* FIXME: The use of ungetc has been deprecated since C99 when it + occurs at the beginning of a binary stream, and this may happen + on /dev/null. One could add a "if (c != EOF)" test, but let's + wait for some discussion in comp.std.c first... */ ungetc (c, stream); if (MPFR_UNLIKELY (str_size == (size_t) -1 || str_size == 0 || -- cgit v1.2.1