[RTEMS Project] #3012: Global C++ IO streams are broken (cout, cin, cerr)

RTEMS trac trac at rtems.org
Wed May 10 00:21:49 UTC 2017


#3012: Global C++ IO streams are broken (cout, cin, cerr)
-----------------------------+--------------------------
 Reporter:  Sebastian Huber  |       Owner:  Chris Johns
     Type:  defect           |      Status:  assigned
 Priority:  normal           |   Milestone:  Indefinite
Component:  GCC              |     Version:  4.12
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+--------------------------

Comment (by Chris Johns):

 This approach concerns me because it breaks {{{std::cout}}} in the other
 direction. If this is fine for C++'s {{{stdout}}} it should be ok for a
 thread's C {{{stdout}}} and given newlib has:

 {{{
 #define      stdout  (_REENT->_stdout)
 }}}

 we are not consistent.

 Is moving at run-time the address of {{{stdout}}}, which newlib does,
 conflicting with another standard like C++? I assume the stdc++ code is
 capturing a reference to {{{stdout}}} so closing and then opening a file
 and assigning it to {{{stdio}}} works.

 This is a difficult issue.

--
Ticket URL: <http://devel.rtems.org/ticket/3012#comment:1>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list