ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
gcc.hpp
Go to the documentation of this file.
1// (C) Copyright John Maddock 2001 - 2003.
2// (C) Copyright Darin Adler 2001 - 2002.
3// (C) Copyright Jens Maurer 2001 - 2002.
4// (C) Copyright Beman Dawes 2001 - 2003.
5// (C) Copyright Douglas Gregor 2002.
6// (C) Copyright David Abrahams 2002 - 2003.
7// (C) Copyright Synge Todo 2003.
8// Use, modification and distribution are subject to the
9// Boost Software License, Version 1.0. (See accompanying file
10// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11
12// See http://www.boost.org for most recent version.
13
14// GNU C++ compiler setup:
15
16#if __GNUC__ < 3
17# if __GNUC_MINOR__ == 91
18// egcs 1.1 won't parse shared_ptr.hpp without this:
19# define BOOST_NO_AUTO_PTR
20# endif
21# if __GNUC_MINOR__ < 95
22//
23// Prior to gcc 2.95 member templates only partly
24// work - define BOOST_MSVC6_MEMBER_TEMPLATES
25// instead since inline member templates mostly work.
26//
27# define BOOST_NO_MEMBER_TEMPLATES
28# if __GNUC_MINOR__ >= 9
29# define BOOST_MSVC6_MEMBER_TEMPLATES
30# endif
31# endif
32
33# if __GNUC_MINOR__ < 96
34# define BOOST_NO_SFINAE
35# endif
36
37# if __GNUC_MINOR__ <= 97
38# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
39# define BOOST_NO_OPERATORS_IN_NAMESPACE
40# endif
41
42# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
43# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
44# define BOOST_NO_IS_ABSTRACT
45# define BOOST_NO_CXX11_EXTERN_TEMPLATE
46// Variadic macros do not exist for gcc versions before 3.0
47# define BOOST_NO_CXX11_VARIADIC_MACROS
48#elif __GNUC__ == 3
49# if defined(__PATHSCALE__)
50# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
51# define BOOST_NO_IS_ABSTRACT
52# endif
53//
54// gcc-3.x problems:
55//
56// Bug specific to gcc 3.1 and 3.2:
57//
58# if ((__GNUC_MINOR__ == 1) || (__GNUC_MINOR__ == 2))
59# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
60# endif
61# if __GNUC_MINOR__ < 4
62# define BOOST_NO_IS_ABSTRACT
63# endif
64# define BOOST_NO_CXX11_EXTERN_TEMPLATE
65#endif
66#if __GNUC__ < 4
67//
68// All problems to gcc-3.x and earlier here:
69//
70# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
71# ifdef __OPEN64__
72# define BOOST_NO_IS_ABSTRACT
73# endif
74#endif
75
76#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
77// Previous versions of GCC did not completely implement value-initialization:
78// GCC Bug 30111, "Value-initialization of POD base class doesn't initialize
79// members", reported by Jonathan Wakely in 2006,
80// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111 (fixed for GCC 4.4)
81// GCC Bug 33916, "Default constructor fails to initialize array members",
82// reported by Michael Elizabeth Chastain in 2007,
83// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916 (fixed for GCC 4.2.4)
84// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
85# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
86#endif
87
88#if !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
89# define BOOST_NO_EXCEPTIONS
90#endif
91
92//
93// Threading support: Turn this on unconditionally here (except for
94// those platforms where we can know for sure). It will get turned off again
95// later if no threading API is detected.
96//
97#if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && \
98 !defined(__linux__)
99# define BOOST_HAS_THREADS
100#endif
101
102//
103// gcc has "long long"
104//
105#define BOOST_HAS_LONG_LONG
106
107//
108// gcc implements the named return value optimization since version 3.1
109//
110#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
111# define BOOST_HAS_NRVO
112#endif
113
114//
115// Dynamic shared object (DSO) and dynamic-link library (DLL) support
116//
117#if __GNUC__ >= 4
118# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && \
119 !defined(__CYGWIN__)
120// All Win32 development environments, including 64-bit Windows and MinGW, define
121// _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment,
122// so does not define _WIN32 or its variants.
123# define BOOST_HAS_DECLSPEC
124# define BOOST_SYMBOL_EXPORT __attribute__((dllexport))
125# define BOOST_SYMBOL_IMPORT __attribute__((dllimport))
126# else
127# define BOOST_SYMBOL_EXPORT __attribute__((visibility("default")))
128# define BOOST_SYMBOL_IMPORT
129# endif
130# define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default")))
131#else
132// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
133# define BOOST_SYMBOL_EXPORT
134#endif
135
136//
137// RTTI and typeinfo detection is possible post gcc-4.3:
138//
139#if __GNUC__ * 100 + __GNUC_MINOR__ >= 403
140# ifndef __GXX_RTTI
141# ifndef BOOST_NO_TYPEID
142# define BOOST_NO_TYPEID
143# endif
144# ifndef BOOST_NO_RTTI
145# define BOOST_NO_RTTI
146# endif
147# endif
148#endif
149
150// C++0x features in 4.3.n and later
151//
152#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && \
153 defined(__GXX_EXPERIMENTAL_CXX0X__)
154// C++0x features are only enabled when -std=c++0x or -std=gnu++0x are
155// passed on the command line, which in turn defines
156// __GXX_EXPERIMENTAL_CXX0X__.
157# define BOOST_HAS_DECLTYPE
158# define BOOST_HAS_RVALUE_REFS
159# define BOOST_HAS_STATIC_ASSERT
160# define BOOST_HAS_VARIADIC_TMPL
161#else
162# define BOOST_NO_CXX11_DECLTYPE
163# define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
164# define BOOST_NO_CXX11_RVALUE_REFERENCES
165# define BOOST_NO_CXX11_STATIC_ASSERT
166
167// Variadic templates compiler:
168// http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html
169# if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || \
170 ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && \
171 defined(__GXX_EXPERIMENTAL_CXX0X__))
172# define BOOST_HAS_VARIADIC_TMPL
173# else
174# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
175# endif
176#endif
177
178// C++0x features in 4.4.n and later
179//
180#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || \
181 !defined(__GXX_EXPERIMENTAL_CXX0X__)
182# define BOOST_NO_CXX11_AUTO_DECLARATIONS
183# define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
184# define BOOST_NO_CXX11_CHAR16_T
185# define BOOST_NO_CXX11_CHAR32_T
186# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
187# define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
188# define BOOST_NO_CXX11_DELETED_FUNCTIONS
189#endif
190
191#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
192# define BOOST_NO_SFINAE_EXPR
193#endif
194
195// C++0x features in 4.5.0 and later
196//
197#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || \
198 !defined(__GXX_EXPERIMENTAL_CXX0X__)
199# define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
200# define BOOST_NO_CXX11_LAMBDAS
201# define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
202# define BOOST_NO_CXX11_RAW_LITERALS
203# define BOOST_NO_CXX11_UNICODE_LITERALS
204#endif
205
206// C++0x features in 4.5.1 and later
207//
208#if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40501) || \
209 !defined(__GXX_EXPERIMENTAL_CXX0X__)
210// scoped enums have a serious bug in 4.4.0, so define BOOST_NO_CXX11_SCOPED_ENUMS before 4.5.1
211// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
212# define BOOST_NO_CXX11_SCOPED_ENUMS
213#endif
214
215// C++0x features in 4.6.n and later
216//
217#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || \
218 !defined(__GXX_EXPERIMENTAL_CXX0X__)
219# define BOOST_NO_CXX11_CONSTEXPR
220# define BOOST_NO_CXX11_NOEXCEPT
221# define BOOST_NO_CXX11_NULLPTR
222# define BOOST_NO_CXX11_RANGE_BASED_FOR
223# define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
224#endif
225
226#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || \
227 !defined(__GXX_EXPERIMENTAL_CXX0X__)
228# define BOOST_NO_CXX11_TEMPLATE_ALIASES
229#endif
230// C++0x features not supported at all yet
231//
232#define BOOST_NO_CXX11_DECLTYPE_N3276
233
234#ifndef BOOST_COMPILER
235# define BOOST_COMPILER "GNU C++ version " __VERSION__
236#endif
237
238// ConceptGCC compiler:
239// http://www.generic-programming.org/software/ConceptGCC/
240#ifdef __GXX_CONCEPTS__
241# define BOOST_HAS_CONCEPTS
242# define BOOST_COMPILER "ConceptGCC version " __VERSION__
243#endif
244
245// versions check:
246// we don't know gcc prior to version 2.90:
247#if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90)
248# error "Compiler not configured - please reconfigure"
249#endif
250//
251// last known and checked version is 4.6 (Pre-release):
252#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6))
253# if defined(BOOST_ASSERT_CONFIG)
254# error \
255 "Unknown compiler version - please run the configure tests and report the results"
256# else
257// we don't emit warnings here anymore since there are no defect macros defined for
258// gcc post 3.4, so any failures are gcc regressions...
259//# warning "Unknown compiler version - please run the configure tests and report the results"
260# endif
261#endif