https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67195
Bug ID: 67195
Summary: cpp and g++ does not define __GLIBCXX__
Product: gcc
Version: 5.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: noloader at gmail dot com
Target Milestone: ---
I'm trying to detect a debug build, and enjoy the benefit of additional
instrumentation:
# Debug testing
ifneq ($(filter -DDEBUG -DDEBUG=1 -O0 -O1 -Og,$(CXXFLAGS)),)
CXXFLAGS += -D_GLIBCXX_DEBUG=1 -D_GLIBCXX_CONCEPT_CHECKS=1
endif # Debug build
According to Chapter 3. Using Macros
(https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html):
__GLIBCXX__
The current version of libstdc++ in compressed ISO date format, as an
unsigned long.
However, on Fedora22 x86_64:
$ cpp -x c++ -dM < /dev/null | grep -i lib
$ cpp -x c++ -dM < /dev/null | grep -i c++
#define __GLIBCXX_BITSIZE_INT_N_0 128
#define __GLIBCXX_TYPE_INT_N_0 __int128
$ cpp -x c++ -dM < /dev/null | grep -i cxx
#define __GLIBCXX_BITSIZE_INT_N_0 128
#define __GLIBCXX_TYPE_INT_N_0 __int128
$ g++ -E -dM - < /dev/null | grep -i lib
$ g++ -E -dM - < /dev/null | grep -i c++
$ g++ -E -dM - < /dev/null | grep -i cxx
$
-----
$ uname -a
Linux localhost.localdomain 4.1.3-201.fc22.x86_64 #1 SMP Wed Jul 29 19:50:22
UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ g++ --version
g++ (GCC) 5.1.1 20150618 (Red Hat 5.1.1-4)
Copyright (C) 2015 Free Software Foundation, Inc