xref: /freebsd/contrib/libxo/warnings.mk (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
1#
2# $Id$
3#
4# Copyright 2011, Juniper Networks, Inc.
5# All rights reserved.
6# This SOFTWARE is licensed under the LICENSE provided in the
7# ../Copyright file. By downloading, installing, copying, or otherwise
8# using the SOFTWARE, you agree to be bound by the terms of that
9# LICENSE.
10#
11# Commonly used sets of warnings
12#
13
14MIN_WARNINGS?= -W -Wall
15
16LOW_WARNINGS?= ${MIN_WARNINGS} \
17    -Wstrict-prototypes \
18    -Wmissing-prototypes \
19    -Wpointer-arith
20
21MEDIUM_WARNINGS?= ${LOW_WARNINGS} -Werror
22
23HIGH_WARNINGS?= ${MEDIUM_WARNINGS} \
24    -Waggregate-return \
25    -Wcast-align \
26    -Wcast-qual \
27    -Wchar-subscripts \
28    -Wcomment \
29    -Wformat \
30    -Wimplicit \
31    -Wmissing-declarations \
32    -Wnested-externs \
33    -Wparentheses \
34    -Wreturn-type \
35    -Wshadow \
36    -Wswitch \
37    -Wtrigraphs \
38    -Wuninitialized \
39    -Wunused \
40    -Wwrite-strings
41
42HIGHER_WARNINGS?= ${HIGH_WARNINGS} \
43    -Winline \
44    -Wbad-function-cast \
45    -Wpacked \
46    -Wpadded \
47    -Wstrict-aliasing
48
49ifeq "${LIBXO_WARNINGS}" "HIGH"
50WARNINGS += ${HIGH_WARNINGS}
51else
52WARNINGS += ${LOW_WARNINGS}
53endif
54
55ifeq "${GCC_WARNINGS}" "yes"
56WARNINGS += -fno-inline-functions-called-once
57endif
58