Thread: Building GCC 10.x warning question.

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    3,973

    Building GCC 10.x warning question.

    Code:
    ../../gcc-git/gcc/cp/coroutines.cc:2700:22: warning: defaulted and deleted functions only available with '-std=c++11' or '-std=gnu++11'
     2700 |   var_nest_node () = default;
    gcc/coroutines.cc at master * gcc-mirror/gcc * GitHub

    I am building a very recent (less than one week old) MinGW64 GCC for MSys2 (an cygwin clone) for 32 and 64 bit MinGW GCC work.

    And, I got over an thousand warnings at first; I am now trying to reduce the warnings by removing or ignoring the un-important ones.

    I have no idea if this is one to ignore or try to fix.

    Can someone tell me which it is?

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,230
    Wait, so you're not compiling with respect to C++11 or later?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    3,973
    Quote Originally Posted by laserlight View Post
    Wait, so you're not compiling with respect to C++11 or later?
    Found the exact command; will try using C++11 standard next. -std=gnu++11

    Code:
    i686-w64-mingw32-g++ -std=gnu++98 -fno-PIE -c  -DIN_GCC_FRONTEND -g -D__USE_MINGW_ACCESS -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -Icp -I../../gcc-git/gcc -I../../gcc-git/gcc/cp -I../../gcc-git/gcc/../include -I../../gcc-git/gcc/../libcpp/include -I/mingw32/include -I/mingw32/include -I/mingw32/include  -I../../gcc-git/gcc/../libdecnumber -I../../gcc-git/gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc-git/gcc/../libbacktrace -I/mingw32/include -D__USE_MINGW_ANSI_STDIO=1 -I/mingw32/include -o cp/coroutines.o -MT cp/coroutines.o -MMD -MP -MF cp/.deps/coroutines.TPo ../../gcc-git/gcc/cp/coroutines.cc
    I was thinking that might be the correct solution; but, since it was not already done by the MSys2 package I am trying to fix I was not sure.

    It takes about 12 hours to build so could be a day or two before I can confirm it does not cause a new problem

    Edit: I am having issues finding where "gnu++98" is being set; could be a few weeks before I locate it.

    Edit2: Looks like I will ignore it the warning only looks to happen on stage 1 or before; stages 2 and 3 do not have the warning.

    Tim S.
    Last edited by stahta01; 01-16-2021 at 05:46 PM.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,230
    What is the version of g++ that you're using? I believe g++ has defaulted to C++11 or later for a few major versions now, e.g., a quick check shows g++ 6.5 will default to the GNU dialect of C++14.
    Last edited by laserlight; 01-16-2021 at 05:47 PM.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    3,973
    Since, I posted the first post in this thread I have found that GCC sets explicit versions of at least different 4 values; still have not found where std=gnu++98 is set.

    But, I have decided to ignore this warning since it only happens once in building stage 1 (or at least before stage 2) of GCC.

    Tim S.
    Last edited by stahta01; 01-16-2021 at 05:51 PM. Reason: Grammar
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. plaguing warning messages when building project...
    By csharp100 in forum C Programming
    Replies: 10
    Last Post: 07-12-2012, 03:04 PM
  2. Question !!!! Warning Message!!!!
    By her4men in forum C Programming
    Replies: 6
    Last Post: 03-01-2010, 11:21 AM
  3. loop building question
    By panfilero in forum C Programming
    Replies: 8
    Last Post: 12-01-2005, 08:23 AM
  4. Newbie question Building Library Binaries
    By SkinneyEd in forum C++ Programming
    Replies: 3
    Last Post: 10-25-2005, 10:30 AM
  5. Warning when building!
    By electrolove in forum C Programming
    Replies: 21
    Last Post: 02-12-2003, 09:39 PM

Tags for this Thread