This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Sequence points in fscanf
- From: Florian Weimer <fweimer at redhat dot com>
- To: Martin Sebor <msebor at redhat dot com>, libc-help <libc-help at sourceware dot org>
- Date: Tue, 17 Feb 2015 17:45:37 +0100
- Subject: Re: Sequence points in fscanf
- Authentication-results: sourceware.org; auth=none
- References: <54E36962 dot 6000308 at redhat dot com> <54E36F15 dot 5000900 at redhat dot com>
On 02/17/2015 05:40 PM, Martin Sebor wrote:
> On 02/17/2015 09:16 AM, Florian Weimer wrote:
>> Is there a sequence point between the assignments for the individual
>> format specifiers? I think there is not (in C11). Does this trigger
>> undefined behavior if application code uses the same object to store
>> multiple format conversion results?
>
> Quoting from 7.21.6 Formatted input/output functions, paragraph
> 1:
>
> The formatted input/output functions shall behave as if there
> is a sequence point after the actions associated with each
> specifier. 274)
>
> Footnote 274) The fprintf functions perform writes to memory
> for the %n specifier.
Thanks, this certainly settles it!
--
Florian Weimer / Red Hat Product Security