incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-319) std::filebuf::open(..., ios::app) unexpectedly succeeds
Date Fri, 01 Jun 2007 21:44:15 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500869
] 

Martin Sebor commented on STDCXX-319:
-------------------------------------

So the issue should be addressed in the standard -- see my post to the C++ reflector below:

-------- Original Message --------
Subject: another missing openmode (issue 596)
Date: Sun, 27 May 2007 17:06:54 -0600
From: Martin Sebor <sebor@roguewave.com>
Reply-To: c++std-lib@accu.org
Organization: Rogue Wave Software
To: undisclosed-recipients:;

To: C++ libraries mailing list
Message c++std-lib-18744

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#596

...besides "a+" and "a+b" the C++ table is also missing a row
for a lone app bit which in at least two current implementation
as well as in Classic Iostreams corresponds to the C stdio "a"
mode and has been traditionally documented as implying ios::out.
Which means the table should also have a row for in|app meaning
the same thing as "a+" already proposed in the issue.

Howard, unless this is somehow implied somewhere else in the text
and I missed it, can you please add my comments to the issue?

Thanks
Martin


> std::filebuf::open(..., ios::app) unexpectedly succeeds
> -------------------------------------------------------
>
>                 Key: STDCXX-319
>                 URL: https://issues.apache.org/jira/browse/STDCXX-319
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 27. Input/Output
>    Affects Versions: 4.1.3, 4.1.2
>         Environment: all
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>
> According to filebuf.members, p2, filebuf::open(const char*, openmode mode) is not some
combination of the flags listed in Table 113 the call is supposed to fail. Since ios::app
only appears in conjunction with ios::out (and ios::binary|ios::out) the call in the program
below should fail.
> $ cat t.cpp && make t && ./t
> #include <cassert>
> #include <fstream>
> int main ()
> {
>     std::filebuf fb;
>     const std::filebuf* const pfb = fb.open ("dummy", std::ios::app);
>     assert (0 == pfb);
> }
> gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include
-I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/../rwtest -I/build/sebor/dev/stdlib/../rwtest/include
-I/build/sebor/dev/stdlib/tests/include  -pedantic -nostdinc++ -g  -W -Wall -Wcast-qual -Winline
-Wshadow -Wwrite-strings -Wno-long-long   t.cpp
> gcc t.o -o t -L/build/sebor/gcc-4.1.0-11s/rwtest -lrwtest11s  -L/build/sebor/gcc-4.1.0-11s/lib
-lstd11s  -lsupc++ -lm 
> Assertion failed: 0 == pfb, file t.cpp, line 10
> Abort (core dumped)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message