Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7574685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:29:43+00:00 2026-05-30T16:29:43+00:00

Compiling the following: // file main.cpp #include <string> #include <boost/lexical_cast.hpp> int main() { boost::lexical_cast<std::string>(

  • 0

Compiling the following:

// file main.cpp

#include <string>
#include <boost/lexical_cast.hpp>

int main()
{
    boost::lexical_cast<std::string>( 656.16 );
    return 0;
}

yields to this:

/usr/local/include/boost/lexical_cast.hpp:1184: warning: ISO C++ does not support the ‘%lg’ printf format

Why? How to avoid this warning?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:29:45+00:00Added an answer on May 30, 2026 at 4:29 pm

    I GCC, there’s a simple trick to silence all warnings from a specific library’s headers. Simply treat them as system headers. This is safe, as far as I know, and I use it as a course of standard practice.

    That is, tweak your command line to use -isystem instead of -I to specify the Boost header location. Everything else stays the same.

    For instance, this is taken from a Makefile of one of my projects:

    BOOST=/usr/local/Cellar/boost/1.48.0
    CXXFLAGS+=-isystem$(BOOST)
    

    Note: it is important that you don’t silence warnings in general in your projects. On the contrary, you should treat all warnings as errors (-Werror) and warn as much as possible (.e.g. -Wall -Wextra). The above disables only those warnings caused by Boost, not from your own code. This is as it should be.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this C++ file: #include <iostream> int main(int argc, char *argv[]) { std::cout
I have the following code #include <iostream> #include <vector> using namespace std; int distance(vector<int>&
I have two source files: Source FIle 1 (assembler.c): #include parser.c int main() {
When compiling the following code: void DoSomething(int Numbers[]) { int SomeArray[] = Numbers; }
Is it possible to have g++ show an error when compiling the following file
I write the following file temp.hs: import qualified Data.Set import System.Environment main :: IO
I have issues with the following code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include
When compiling the following simpleType with the XJC compile (from the JAXB package)... <xs:simpleType
When compiling the following instruction: movl 4(%ebp), 8(%ebp) I got: too many memory reference
I'm having problems compiling the following program. I'm using gcc -framework Foundation inherit8.1m and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.