Modify

Ticket #7477 (reopened Bugs)

Opened 19 months ago

Last modified 19 months ago

boost:::format will not compile under VC++ without "Microsoft language extensions"

Reported by: Jive Dadson <jdadson@…> Owned by: samuel_krempp
Milestone: To Be Determined Component: format
Version: Boost 1.51.0 Severity: Problem
Keywords: format basic_streambuf throw() Cc:

Description

Boost::format will not compile under Microsoft VC++ unless Microsoft Language Extensions (/Za) are turned OFF. When MS Language Extensions are turned ON, the compiler complains because boost overrides some virtual functions in std:: classes with functions lacking a "throw()" specifier. One of the functions is the destructor ~basic_streambuf().

I do not know if this is a bug or a misunderstanding on my part. If it is a bug, I do not know whether it is on the MS or boost side. However, it should be a simple matter to decorate those functions with "throw()." That could save someone a lot of trouble.

Attachments

Change History

comment:1 Changed 19 months ago by Jive Dadson <jdadson@…>

comment:2 Changed 19 months ago by Jive Dadson <jdadson@…>

Eratum: I should have said, "Boost::format will not compile under Microsoft VC++ unless Microsoft Language Extensions (/Za) are turned ON." I cannot find an "edit" button on the ticket.

comment:3 Changed 19 months ago by michel

  • Status changed from new to closed
  • Resolution set to invalid

Don't use /Za.

The /Za option is buggy and you shouldn't use it. See the posts from Stephan T. Lavavej (Visual C++ libraries developer) such as  this and  this. Also,  Boost's warning guidelines might be useful for you.

comment:4 Changed 19 months ago by michel

Ah, I meant "don't turn off Microsoft Language Extensions."

comment:5 Changed 19 months ago by Jive Dadson <jdadson@…>

I would like for the decision to close this item to be reviewed. I spent hours figuring out what was wrong. Others will too. Or give up. What could it hurt to add "throw()" to some functions that cannot throw an exception?

comment:6 Changed 19 months ago by michel

  • Status changed from closed to reopened
  • Resolution invalid deleted

comment:7 Changed 19 months ago by Jive Dadson <jdadson@…>

@James I tracked it down. The bug is in the VC++ header file The declaration for ~basic_streambuf() does not have a "throw()" exception-specifier. Section 27.6.3, C++11; Section 27.5.1 C++03. Nevertheless, boost could add it harmlessly. The destructor is on line 65 in alt_sstream_impl.hpp.

virtual ~basic_altstringbuf() throw() edit, j. dadson

{ dealloc(); }

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as reopened
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.