Send inn-workers mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.isc.org/mailman/listinfo/inn-workers
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of inn-workers digest..."
Today's Topics:
1. fflush stdin in actsync (Julien ?LIE)
2. Re: fflush stdin in actsync (Richard Kettlewell)
----------------------------------------------------------------------
Message: 1
Date: Sun, 3 Apr 2016 08:58:46 +0200
From: Julien ?LIE <[email protected]>
To: "[email protected]" <[email protected]>
Subject: fflush stdin in actsync
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed
Hi all,
In backends/actsync.c, we use "fflush(stdin)" that has undefined
behaviour (portability issue).
Has someone ever encountered an issue with actsync because of that?
Is it worth trying to fix it? (using scanf for instance and discarding
output)
--
Julien ?LIE
? Petite annonce : Astronaute recherche femme lunatique. ?
------------------------------
Message: 2
Date: Sun, 3 Apr 2016 12:55:02 +0100
From: Richard Kettlewell <[email protected]>
To: [email protected]
Subject: Re: fflush stdin in actsync
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
On 2016-04-03 07:58, Julien ?LIE wrote:
> Hi all,
>
> In backends/actsync.c, we use "fflush(stdin)" that has undefined
> behaviour (portability issue).
> Has someone ever encountered an issue with actsync because of that?
>
> Is it worth trying to fix it? (using scanf for instance and discarding
> output)
>
It's undefined in C99 but has defined behavior in SUS:
For a stream open for reading, if the file is not already at EOF, and
the file is one capable of seeking, the file offset of the underlying
open file description shall be set to the file position of the stream,
and any characters pushed back onto the stream by ungetc() or ungetwc()
that have not subsequently been read from the stream shall be discarded
(without further changing the file offset)
http://pubs.opengroup.org/onlinepubs/9699919799/functions/fflush.html
So it depends what the portability goal is.
ttfn/rjk
------------------------------
_______________________________________________
inn-workers mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/inn-workers
End of inn-workers Digest, Vol 83, Issue 2
******************************************