FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
compiler_gnu.hpp
Go to the documentation of this file.
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
16#if !defined(FEAT_COMPILER) && defined(__GNUC__)
17
18// compute linear sortable gcc version
19#define FEAT_COMPILER_GNU (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
20
21// define compiler string
22#define FEAT_COMPILER ("g++ (GCC) " FEAT_STRINGIFY(__GNUC__) "." FEAT_STRINGIFY(__GNUC_MINOR__) "." FEAT_STRINGIFY(__GNUC_PATCHLEVEL__))
23
24#if(FEAT_COMPILER_GNU >= 40900)
25# define FEAT_PRAGMA_IVDEP _Pragma("GCC ivdep")
26#endif
27
28
29#if(FEAT_COMPILER_GNU >= 50000)
30#define FEAT_DISABLE_WARNINGS _Pragma("GCC diagnostic push") \
31 _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
32 _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
33 _Pragma("GCC diagnostic ignored \"-Wundef\"") \
34 _Pragma("GCC diagnostic ignored \"-Wstrict-aliasing\"") \
35 _Pragma("GCC diagnostic ignored \"-Wparentheses\"") \
36 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
37 _Pragma("GCC diagnostic ignored \"-Wshadow\"") \
38 _Pragma("GCC diagnostic ignored \"-Wsuggest-override\"") \
39 _Pragma("GCC diagnostic ignored \"-Wdouble-promotion\"") \
40 _Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
41 _Pragma("GCC diagnostic ignored \"-Wignored-qualifiers\"") \
42 _Pragma("GCC diagnostic ignored \"-Wduplicated-branches\"")
43#else
44#define FEAT_DISABLE_WARNINGS _Pragma("GCC diagnostic push") \
45 _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") \
46 _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
47 _Pragma("GCC diagnostic ignored \"-Wundef\"") \
48 _Pragma("GCC diagnostic ignored \"-Wstrict-aliasing\"") \
49 _Pragma("GCC diagnostic ignored \"-Wparentheses\"") \
50 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
51 _Pragma("GCC diagnostic ignored \"-Wshadow\"") \
52 _Pragma("GCC diagnostic ignored \"-Wdouble-promotion\"") \
53 _Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
54 _Pragma("GCC diagnostic ignored \"-Wignored-qualifiers\"")
55#endif
56
57#define FEAT_RESTORE_WARNINGS _Pragma("GCC diagnostic pop")
58
59// define the noinline specifier
60#define NOINLINE __attribute__((noinline))
61
62#define FORCE_INLINE inline __attribute__((always_inline))
63
64#endif // !defined(FEAT_COMPILER) && defined(__GNUC__)