stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek (JIRA)" <j...@apache.org>
Subject [jira] Updated: (STDCXX-204) std::filebuf::overflow(EOF) writes garbage in unbuffered mode
Date Mon, 03 Dec 2007 23:59:43 GMT

     [ https://issues.apache.org/jira/browse/STDCXX-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Travis Vitek updated STDCXX-204:
--------------------------------

    Attachment: stdcxx-240.patch

Well, the test suite doesn't build cleanly if _RWSTD_NO_EXCEPTIONS is defined. There are many
undefined variable warnings, and many places that use keywords try/throw/catch without checking
the macro first.


I can't fully say that this is working completely because many of the tests don't compile
when _RWSTD_NO_EXCEPTIONS is defined. I also get some warnings because of mismatches. On AIX,
for example, I get these warnings.

"/amd/devco/vitek/stdcxx/trunk/include/new", line 216.7: 1540-0419 (W) An exception-specification
must be specified as "throw(std::bad_alloc)" to match the implicit declaration.
"/amd/devco/vitek/stdcxx/trunk/include/new", line 216.7: 1540-1088 (W) The exception specification
is being ignored.
"/amd/devco/vitek/stdcxx/trunk/include/new", line 223.6: 1540-0419 (W) An exception-specification
must be specified as "throw()" to match the implicit declaration.
"/amd/devco/vitek/stdcxx/trunk/include/new", line 223.6: 1540-1088 (W) The exception specification
is being ignored.
"/amd/devco/vitek/stdcxx/trunk/include/new", line 240.7: 1540-0419 (W) An exception-specification
must be specified as "throw(std::bad_alloc)" to match the implicit declaration.
"/amd/devco/vitek/stdcxx/trunk/include/new", line 240.7: 1540-1088 (W) The exception specification
is being ignored.
"/amd/devco/vitek/stdcxx/trunk/include/new", line 250.6: 1540-0419 (W) An exception-specification
must be specified as "throw()" to match the implicit declaration.
"/amd/devco/vitek/stdcxx/trunk/include/new", line 250.6: 1540-1088 (W) The exception specification
is being ignored.

Not sure how to proceed with this. I'm attaching the patch that checks the above mentioned
macros in the appropriate config headers. It does nothing else.

> std::filebuf::overflow(EOF) writes garbage in unbuffered mode
> -------------------------------------------------------------
>
>                 Key: STDCXX-204
>                 URL: https://issues.apache.org/jira/browse/STDCXX-204
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 27. Input/Output
>    Affects Versions: 4.1.2, 4.1.3
>         Environment: All.
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>             Fix For: 4.2.0
>
>
> The program below dumps core:
> $ cat t.cpp && nice gmake t && ./t
> #include <cassert>
> #include <fstream>
> struct MyBuf: std::filebuf {
>     int_type oflow () {
>          return overflow (traits_type::eof ());
>     }
> };
> int main ()
> {
>     MyBuf f;
>     assert (0 != f.open ("test.file", std::ios::out | std::ios::trunc));
>     assert (0 != f.pubsetbuf (0, 0));
>     assert (MyBuf::traits_type::eof () != f.oflow ());
>     assert (0 == f.pubseekoff (0, std::ios::end, std::ios::out));
> }
> aCC -c -I/amd/devco/sebor/dev/stdlib/include/ansi -I/usr/include  -D_RWSTDDEBUG   -mt
-D_RWSTD_USE_CONFIG -I/amd/devco/sebor/dev/stdlib/include -I/build/sebor/aCC-3.63-15S/include
-I/amd/devco/sebor/dev/stdlib/../rwtest -I/amd/devco/sebor/dev/stdlib/../rwtest/include -I/amd/devco/sebor/dev/stdlib/tests/include
 -Aa +nostl  -g +d  +DD64 +w +W392 +W655 +W684 +W818 +W819 +W849  t.cpp
> aCC t.o -o t -L/build/sebor/aCC-3.63-15S/rwtest -lrwtest15S -Aa +nostl -Wl,+s -Wl,+vnocompatwarnings
-L/build/sebor/aCC-3.63-15S/lib   -mt +DD64 -L/build/sebor/aCC-3.63-15S/lib -lstd15S   -lm
> Assertion failed: 0 == f.pubseekoff (0, std::ios::end, std::ios::out), file t.cpp, line
19
> ABORT instruction (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