This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Immediate status.

4549. vprint_nonunicode_buffered ignores its stream parameter

Section: 31.7.10 [print.fun] Status: Immediate Submitter: Abhinav Agarwal Opened: 2026-03-21 Last modified: 2026-03-25

Priority: Not Prioritized

View all other issues in [print.fun].

View all issues with Immediate status.

Discussion:

The Effects element of vprint_nonunicode_buffered(FILE* stream, string_view fmt, format_args args) in 31.7.10 [print.fun] p14 is specified as:

string out = vformat(fmt, args);
vprint_nonunicode("{}", make_format_args(out));

That call selects the two-argument overload vprint_nonunicode(string_view, format_args) (31.7.10 [print.fun] p13), whose Effects element delegates to vprint_nonunicode(stdout, fmt, args). The caller-supplied stream is discarded and the output destination becomes stdout.

The parallel function vprint_unicode_buffered (31.7.10 [print.fun] p8) correctly passes stream:

string out = vformat(fmt, args);
vprint_unicode(stream, "{}", make_format_args(out));

This is user-visible: print(FILE* stream, ...) (31.7.10 [print.fun] p2) calls vprint_nonunicode_buffered(stream, ...) on the non-UTF-8 buffered path, so the current wording routes output to the wrong stream.

[Croydon 2026-03-24; move to Immediate]

Proposed resolution:

This wording is relative to N5032.

  1. Modify 31.7.10 [print.fun] as indicated:

    void vprint_nonunicode_buffered(FILE* stream, string_view fmt, format_args args);
    

    -14- Effects: Equivalent to:

    string out = vformat(fmt, args);
    vprint_nonunicode(stream, "{}", make_format_args(out));