#4469 closed defect (fixed)

rtems-exeinfo.cpp: Not restoring ostream format errors spotted by Coverity

Reported by: Ryan Long Owned by: Ryan Long <ryan.long@…>
Priority: normal Milestone: 6.1
Component: tool Version: 6
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

CID 1503006: Not restoring ostream format in output_compilation_unit().

   185. format_changed: left changes the format state of std::cout for category adjustfield.
478            std::cout << "   | "
479                      << std::setw (source_max + 1) << std::left
480                      << rld::path::basename (s.source);

CID 1503007: Not restoring ostream format in output_tls().

   11. format_changed: right changes the format state of std::cout for category adjustfield.
   12. format_changed: hex changes the format state of std::cout for category basefield.
   13. format_changed: setfill changes the format state of std::cout for category fill.
   14. format_restored: dec changes the format state of std::cout for category basefield.
   15. format_restored: setfill changes the format state of std::cout for category fill.
704      std::cout << "    data size : " << tls_data_size->value () << std::endl
705                << "     bss size : " << tls_bss_size->value () << std::endl
706                << "    alignment : " << tls_alignment->value () << std::endl
707                << std::right << std::hex << std::setfill ('0')
708                << "    data addr : 0x" << std::setw (8) << tls_data_begin->value ()
709                << std::endl
710                << std::dec << std::setfill (' ')
711                << std::endl;

Change History (3)

comment:1 Changed on Jul 27, 2021 at 6:42:06 PM by Ryan Long <ryan.long@…>

Owner: set to Ryan Long <ryan.long@…>
Resolution: fixed
Status: newclosed

In e146927/rtems-tools:

rtems-exeinfo.cpp: Restore ostream format

CID 1503006: Not restoring ostream format
CID 1503007: Not restoring ostream format

Used a variable to store the format of the ostream before any changes,
and copied what was originally there back into the stream before
returning from the function.

Closes #4469

comment:2 Changed on Jul 29, 2021 at 2:43:57 PM by Ryan Long

Resolution: fixed
Status: closedreopened

comment:3 Changed on Aug 13, 2021 at 7:55:51 PM by Ryan Long

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.