public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11436] New: ios::app bug on RedHat 7.3 with gcc 3.3
@ 2003-07-04 20:21 p_hodigere at yahoo dot com
  2003-07-04 20:59 ` [Bug libstdc++/11436] " bangerth at dealii dot org
  2003-07-05 20:54 ` reichelt at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: p_hodigere at yahoo dot com @ 2003-07-04 20:21 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11436

           Summary: ios::app bug on RedHat 7.3 with gcc 3.3
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: p_hodigere at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org

Using ios::app to open a file fails on RH 7.3 when compiled with gcc 3.3. The 
same application can open the file in append mode when compiled with gcc 2.96.

Attached is the test aplication.

All the following combinations of open mode's fail:
fp.open("some file", ios::app);
fp.open("some file", ios::in | ios::app);
fp.open("some file", ios::in | ios::out | ios::app);

In order to open the file in append mode, both ios::out and ios::app need to 
be used:
fp.open("some file", ios::out | ios::app);

Find below a test application to reproduce this bug.

-Pradeep

#include <iostream.h>
#include <fstream.h>

int main() {

fstream fp;

    fp.open("test.txt", ios::app);

    if (fp.is_open() ) {
        fp << "test\n";
        fp.close();
    }
    else
        cout << "Unable to open file";

    return 0;
}


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libstdc++/11436] ios::app bug on RedHat 7.3 with gcc 3.3
  2003-07-04 20:21 [Bug c++/11436] New: ios::app bug on RedHat 7.3 with gcc 3.3 p_hodigere at yahoo dot com
@ 2003-07-04 20:59 ` bangerth at dealii dot org
  2003-07-05 20:54 ` reichelt at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: bangerth at dealii dot org @ 2003-07-04 20:59 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11436


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libstdc++/11436] ios::app bug on RedHat 7.3 with gcc 3.3
  2003-07-04 20:21 [Bug c++/11436] New: ios::app bug on RedHat 7.3 with gcc 3.3 p_hodigere at yahoo dot com
  2003-07-04 20:59 ` [Bug libstdc++/11436] " bangerth at dealii dot org
@ 2003-07-05 20:54 ` reichelt at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2003-07-05 20:54 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11436


reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From reichelt at gcc dot gnu dot org  2003-07-05 20:54 -------
Not a bug.

According to paragraph 27.8.1.3, there are only two valid modes for opening a
file using ios::app, namely

1.) ios::out | ios::app
2.) ios::out | ios::app | ios::binary

Previous versions of gcc just were less picky.

Regards,
Volker


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-07-05 20:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-04 20:21 [Bug c++/11436] New: ios::app bug on RedHat 7.3 with gcc 3.3 p_hodigere at yahoo dot com
2003-07-04 20:59 ` [Bug libstdc++/11436] " bangerth at dealii dot org
2003-07-05 20:54 ` reichelt at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).