1 # -*- mode: gnumakefile; tab-width: 8; indent-tabs-mode: t; -*-
6 # ***** BEGIN GPL LICENSE BLOCK *****
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software Foundation,
20 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
23 # All rights reserved.
25 # The Original Code is: all of this file.
29 # ***** END GPL LICENSE BLOCK *****
31 # NaN compiler and linker warning levels
32 # On some platforms, you will be flooded with system include file warnings.
33 # Use hmake to filter those away.
36 # Force the correct redefinition
37 LEVEL_1_C_WARNINGS = -FIX_NAN_WARN1A
38 LEVEL_1_CPP_WARNINGS = -FIX_NAN_WARN1B
39 LEVEL_2_C_WARNINGS = -FIX_NAN_WARN2A
40 LEVEL_2_CPP_WARNINGS = -FIX_NAN_WARN2B
41 FIX_STUBS_WARNINGS = -FIX_NAN_WARN3
43 ########################################################################
44 # Level 1: basic C warnings.
45 ifeq (gcc, $(findstring gcc,$(CC)))
46 LEVEL_1_C_WARNINGS = -Wall
47 LEVEL_1_C_WARNINGS += -Wno-char-subscripts
49 ifeq (cc, $(findstring cc,$(CC)))
55 # 1001 # the source file does not end w/ a newline
56 # 1110 # unreachable statement
57 # 1201 # trailing comma in enums is nonstandard
58 # 1209 # constant controlling expressions
59 # 1355 # extra semicolon is ignored
60 # 1424 # unreferenced template paramaters
61 # 1681 # virtual function override
62 # 3201 # unreferenced formal paramaters
64 LEVEL_1_C_WARNINGS = -fullwarn -woff 1001,1110,1201,1209,1355,1424,1681,3201
68 # Microsoft Compilers and cl_wrapper.pl
69 LEVEL_1_C_WARNINGS = -Wall
73 # Level 1: basic CPP warnings.
74 ifeq (g++, $(findstring g++,$(CCC)))
75 LEVEL_1_CPP_WARNINGS = -Wall
76 LEVEL_1_CPP_WARNINGS += -Wno-reorder
78 ifeq (CC, $(findstring CC,$(CCC)))
81 # see warning descriptions above
82 LEVEL_1_CPP_WARNINGS = -woff 1001,1110,1201,1209,1355,1424,1681,3201
86 # Microsoft Compilers and cl_wrapper.pl
87 LEVEL_1_CPP_WARNINGS = -Wall
91 ########################################################################
92 # Level 2: paranoia level C warnings.
93 # DO NOT REUSE LEVEL_1_ DEFINES.
94 ifeq (gcc, $(findstring gcc,$(CC)))
95 LEVEL_2_C_WARNINGS = -Wall
96 LEVEL_2_C_WARNINGS += -W
97 # deliberately enable char-subscript warnings
98 LEVEL_2_C_WARNINGS += -Wshadow
99 LEVEL_2_C_WARNINGS += -Wpointer-arith
100 LEVEL_2_C_WARNINGS += -Wbad-function-cast
101 LEVEL_2_C_WARNINGS += -Wcast-qual
102 LEVEL_2_C_WARNINGS += -Wcast-align
103 LEVEL_2_C_WARNINGS += -Waggregate-return
104 LEVEL_2_C_WARNINGS += -Wstrict-prototypes
105 LEVEL_2_C_WARNINGS += -Wmissing-prototypes
106 LEVEL_2_C_WARNINGS += -Wmissing-declarations
107 LEVEL_2_C_WARNINGS += -Wnested-externs
108 LEVEL_2_C_WARNINGS += -Wredundant-decls
110 ifeq (cc, $(findstring cc,$(CC)))
113 # see warning descriptions above
114 LEVEL_2_C_WARNINGS = -fullwarn -woff 1001,1209,1424,3201
117 # Forte / Sun WorkShop Compilers
118 LEVEL_2_C_WARNINGS = -v
122 # Microsoft Compilers and cl_wrapper.pl
123 LEVEL_2_C_WARNINGS = -Wall
127 # Level 2: paranoia level CPP warnings.
128 # DO NOT REUSE LEVEL_1_ DEFINES.
129 ifeq (g++, $(findstring g++,$(CCC)))
130 LEVEL_2_CPP_WARNINGS = -Wall
131 LEVEL_2_CPP_WARNINGS += -W
132 # deliberately enable char-subscript warnings
133 LEVEL_2_CPP_WARNINGS += -Wshadow
134 LEVEL_2_CPP_WARNINGS += -Wpointer-arith
135 LEVEL_2_CPP_WARNINGS += -Wcast-qual
136 LEVEL_2_CPP_WARNINGS += -Wcast-align
137 # deliberately disable aggregate-return warnings
138 LEVEL_2_CPP_WARNINGS += -Wredundant-decls
139 LEVEL_2_CPP_WARNINGS += -Wreorder
140 LEVEL_2_CPP_WARNINGS += -Wctor-dtor-privacy
141 LEVEL_2_CPP_WARNINGS += -Wnon-virtual-dtor
142 #LEVEL_2_CPP_WARNINGS += -Wold-style-cast
143 LEVEL_2_CPP_WARNINGS += -Woverloaded-virtual
144 LEVEL_2_CPP_WARNINGS += -Wsign-promo
145 LEVEL_2_CPP_WARNINGS += -Wsynth
147 ifeq (CC, $(findstring CC,$(CCC)))
150 # see warning descriptions above
151 LEVEL_2_CPP_WARNINGS = -fullwarn -woff 1209,1424,3201
155 # Microsoft Compilers and cl_wrapper.pl
156 LEVEL_2_CPP_WARNINGS = -Wall
160 ########################################################################
162 ifeq (gcc, $(findstring gcc,$(CC)))
163 FIX_STUBS_WARNINGS = -Wno-unused