Re: Trouble forcing an include with "-include"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16 September 2015 at 10:16, Marc Glisse wrote:
> On Wed, 16 Sep 2015, Jeffrey Walton wrote:
>
>> I'm trying to test for some C++ features via preprocessor macros. Some
>> macros (like __GXX_VERSION__) are only triggered by including a C++
>> standard library file. According to Issue 67195, "cpp and g++ does not
>> define __GLIBCXX__", I should only need to include c++config.h.
>>
>> The following is failing to pickup GCC's standard C++ configuration file:
>>
>>    g++ -include c++config.h -dM -E - < /dev/.null | sort
>
>
> Don't use this - < /dev/null, it only works halfway. Create a true empty
> file empty.cc instead.
>
>> The command (and variations like "-include c\+\+config.h" and
>> "-include bits/c++config.h") produces:
>
>
> bits/c++config.h is the right one.

As shown by looking in pretty much any libstdc++ header file:

#include <bits/c++config.h>

>> I guess a related question is, why is G++ using cc1, and not cc1plus?
>
>
> Add -x c++ (gcc guesses based on the file name). Yes, it would make sense
> for c++ to be the default with g++...

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67023



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux