• R/O
  • SSH

libctools: Commit

This library contains code that extends and simplifies different operations
for C language based programs.


Commit MetaInfo

Revisiónd6aca2012d93778a283d764237f576b4160b2d67 (tree)
Tiempo2017-10-08 21:00:05
Autors.gusarov
Commiters.gusarov

Log Message

external_headers.h: Some masked warnings could not be found in the old gcc.
So introduced a way to mask warnings depending on the gcc version

Cambiar Resumen

Diferencia incremental

diff -r 6e1804bfdc14 -r d6aca2012d93 include/ctools/predef/external_headers.h
--- a/include/ctools/predef/external_headers.h Sun Oct 08 14:24:33 2017 +0300
+++ b/include/ctools/predef/external_headers.h Sun Oct 08 15:00:05 2017 +0300
@@ -33,6 +33,19 @@
3333 # error CT_GCC_IGNORE_WARNING_REORDER must be undefined
3434 # endif
3535
36+# ifdef CT_GCC_BASE_WARNING_LIST
37+# error CT_GCC_BASE_WARNING_LIST must be undefined
38+# endif
39+
40+# ifdef CT_GCC_4_8_ABOVE_WARNING_LIST
41+# error CT_GCC_4_8_ABOVE_WARNING_LIST must be undefined
42+# endif
43+
44+# ifdef CT_GCC_5_0_ABOVE_WARNING_LIST
45+# error CT_GCC_5_0_ABOVE_WARNING_LIST must be undefined
46+# endif
47+
48+
3649 # define CT_GCC_WARNING_HELPER1__(x) CT_STRINGIFY2(GCC diagnostic ignored x)
3750 # define CT_GCC_WARNING_HELPER2__(y) CT_GCC_WARNING_HELPER1__(#y)
3851 # define CT_GCC_IGNORE_WARNING(x) _Pragma(CT_GCC_WARNING_HELPER2__(x))
@@ -42,6 +55,31 @@
4255 # else
4356 # define CT_GCC_IGNORE_WARNING_REORDER
4457 # endif
58+
59+# define CT_GCC_BASE_WARNING_LIST\
60+ CT_GCC_IGNORE_WARNING(-Wcast-qual)\
61+ CT_GCC_IGNORE_WARNING(-Winline)\
62+ CT_GCC_IGNORE_WARNING_REORDER\
63+ CT_GCC_IGNORE_WARNING(-Wunused-local-typedefs)\
64+ CT_GCC_IGNORE_WARNING(-Wunused-variable)\
65+ CT_GCC_IGNORE_WARNING(-Wuninitialized)\
66+ CT_GCC_IGNORE_WARNING(-Wmaybe-uninitialized)\
67+ CT_GCC_IGNORE_WARNING(-Wextra)
68+
69+# if CT_GCC_VERSION >= 40800
70+# define CT_GCC_4_8_ABOVE_WARNING_LIST\
71+ CT_GCC_IGNORE_WARNING(-Wunused-parameter)
72+# else
73+# define CT_GCC_4_8_ABOVE_WARNING_LIST
74+# endif
75+
76+# if CT_GCC_VERSION >= 50000
77+# define CT_GCC_5_0_ABOVE_WARNING_LIST\
78+ CT_GCC_IGNORE_WARNING(-Wbool-compare)
79+# else
80+# define CT_GCC_5_0_ABOVE_WARNING_LIST
81+# endif
82+
4583 #endif
4684
4785 /* *INDENT-OFF* */
@@ -55,16 +93,9 @@
5593 # if CT_GCC_VERSION >= 40600
5694 # define CT_BEGIN_EXTERNAL_HEADERS\
5795 _Pragma("GCC diagnostic push")\
58- CT_GCC_IGNORE_WARNING(-Wcast-qual)\
59- CT_GCC_IGNORE_WARNING(-Winline)\
60- CT_GCC_IGNORE_WARNING_REORDER\
61- CT_GCC_IGNORE_WARNING(-Wunused-local-typedefs)\
62- CT_GCC_IGNORE_WARNING(-Wunused-variable)\
63- CT_GCC_IGNORE_WARNING(-Wbool-compare)\
64- CT_GCC_IGNORE_WARNING(-Wunused-parameter)\
65- CT_GCC_IGNORE_WARNING(-Wextra)\
66- CT_GCC_IGNORE_WARNING(-Wuninitialized)\
67- CT_GCC_IGNORE_WARNING(-Wmaybe-uninitialized)
96+ CT_GCC_BASE_WARNING_LIST\
97+ CT_GCC_4_8_ABOVE_WARNING_LIST\
98+ CT_GCC_5_0_ABOVE_WARNING_LIST
6899
69100 # define CT_END_EXTERNAL_HEADERS\
70101 _Pragma("GCC diagnostic pop")
@@ -99,16 +130,9 @@
99130 # if CT_GCC_VERSION >= 40600
100131 # define CT_BEGIN_EXTERNAL_HEADERS\
101132 _Pragma("GCC diagnostic push")\
102- CT_GCC_IGNORE_WARNING(-Wcast-qual)\
103- CT_GCC_IGNORE_WARNING(-Winline)\
104- CT_GCC_IGNORE_WARNING_REORDER\
105- CT_GCC_IGNORE_WARNING(-Wunused-local-typedefs)\
106- CT_GCC_IGNORE_WARNING(-Wunused-variable)\
107- CT_GCC_IGNORE_WARNING(-Wbool-compare)\
108- CT_GCC_IGNORE_WARNING(-Wunused-parameter)\
109- CT_GCC_IGNORE_WARNING(-Wextra)\
110- CT_GCC_IGNORE_WARNING(-Wuninitialized)\
111- CT_GCC_IGNORE_WARNING(-Wmaybe-uninitialized)
133+ CT_GCC_BASE_WARNING_LIST\
134+ CT_GCC_4_8_ABOVE_WARNING_LIST\
135+ CT_GCC_5_0_ABOVE_WARNING_LIST
112136
113137 # define CT_END_EXTERNAL_HEADERS\
114138 _Pragma("GCC diagnostic pop")
Show on old repository browser