Mercurial > hg > nginx-quic
annotate auto/cc/clang @ 8667:2a7155733855
Core: removed unnecessary restriction in hash initialization.
Hash initialization ignores elements with key.data set to NULL.
Nevertheless, the initial hash bucket size check didn't skip them,
resulting in unnecessary restrictions on, for example, variables with
long names and with the NGX_HTTP_VARIABLE_NOHASH flag.
Fix is to update the initial hash bucket size check to skip elements
with key.data set to NULL, similarly to how it is done in other parts
of the code.
author | Alexey Radkov <alexey.radkov@gmail.com> |
---|---|
date | Thu, 19 Aug 2021 20:51:27 +0300 |
parents | ceab908790c4 |
children |
rev | line source |
---|---|
4762
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
2 # Copyright (C) Nginx, Inc. |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
3 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
4 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
5 # clang |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
6 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
7 |
7161
325b3042edd6
Configure: fixed clang detection on MINIX.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6603
diff
changeset
|
8 NGX_CLANG_VER=`$CC -v 2>&1 | grep 'version' 2>&1 \ |
7273
ceab908790c4
Configure: fixed clang version detection (closes #1539).
Ruslan Ermilov <ru@nginx.com>
parents:
7161
diff
changeset
|
9 | sed -n -e 's/^.*clang version \(.*\)/\1/p' \ |
ceab908790c4
Configure: fixed clang version detection (closes #1539).
Ruslan Ermilov <ru@nginx.com>
parents:
7161
diff
changeset
|
10 -e 's/^.*LLVM version \(.*\)/\1/p'` |
4762
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
11 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
12 echo " + clang version: $NGX_CLANG_VER" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
13 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
14 have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
15 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
16 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
17 CC_TEST_FLAGS="-pipe" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
18 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
19 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
20 # optimizations |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
21 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
22 #NGX_CLANG_OPT="-O2" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
23 #NGX_CLANG_OPT="-Oz" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
24 NGX_CLANG_OPT="-O" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
25 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
26 case $CPU in |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
27 pentium) |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
28 # optimize for Pentium |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
29 CPU_OPT="-march=pentium" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
30 NGX_CPU_CACHE_LINE=32 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
31 ;; |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
32 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
33 pentiumpro | pentium3) |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
34 # optimize for Pentium Pro, Pentium II and Pentium III |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
35 CPU_OPT="-march=pentiumpro" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
36 NGX_CPU_CACHE_LINE=32 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
37 ;; |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
38 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
39 pentium4) |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
40 # optimize for Pentium 4 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
41 CPU_OPT="-march=pentium4" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
42 NGX_CPU_CACHE_LINE=128 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
43 ;; |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
44 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
45 athlon) |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
46 # optimize for Athlon |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
47 CPU_OPT="-march=athlon" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
48 NGX_CPU_CACHE_LINE=64 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
49 ;; |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
50 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
51 opteron) |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
52 # optimize for Opteron |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
53 CPU_OPT="-march=opteron" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
54 NGX_CPU_CACHE_LINE=64 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
55 ;; |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
56 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
57 esac |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
58 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
59 CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
60 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
61 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
62 CFLAGS="$CFLAGS -pipe $CPU_OPT" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
63 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
64 if [ ".$PCRE_OPT" = "." ]; then |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
65 PCRE_OPT="-O2 -pipe $CPU_OPT" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
66 else |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
67 PCRE_OPT="$PCRE_OPT -pipe" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
68 fi |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
69 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
70 if [ ".$ZLIB_OPT" = "." ]; then |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
71 ZLIB_OPT="-O2 -pipe $CPU_OPT" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
72 else |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
73 ZLIB_OPT="$ZLIB_OPT -pipe" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
74 fi |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
75 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
76 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
77 # warnings |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
78 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
79 CFLAGS="$CFLAGS $NGX_CLANG_OPT -Wall -Wextra -Wpointer-arith" |
5459
fedf777c6b24
Configure: enable -Wconditional-uninitialized with clang.
Ruslan Ermilov <ru@nginx.com>
parents:
5187
diff
changeset
|
80 CFLAGS="$CFLAGS -Wconditional-uninitialized" |
4762
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
81 #CFLAGS="$CFLAGS -Wmissing-prototypes" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
82 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
83 # we have a lot of unused function arguments |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
84 CFLAGS="$CFLAGS -Wno-unused-parameter" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
85 |
5714
80bd391c90d1
Configure: added -Wno-deprecated-declarations on OS X.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5539
diff
changeset
|
86 # deprecated system OpenSSL library on OS X |
80bd391c90d1
Configure: added -Wno-deprecated-declarations on OS X.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5539
diff
changeset
|
87 if [ "$NGX_SYSTEM" = "Darwin" ]; then |
80bd391c90d1
Configure: added -Wno-deprecated-declarations on OS X.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5539
diff
changeset
|
88 CFLAGS="$CFLAGS -Wno-deprecated-declarations" |
80bd391c90d1
Configure: added -Wno-deprecated-declarations on OS X.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5539
diff
changeset
|
89 fi |
80bd391c90d1
Configure: added -Wno-deprecated-declarations on OS X.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5539
diff
changeset
|
90 |
4762
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
91 # stop on warning |
5539
c86dd32573c0
Configure: enabled -Werror for clang.
Ruslan Ermilov <ru@nginx.com>
parents:
5459
diff
changeset
|
92 CFLAGS="$CFLAGS -Werror" |
4762
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
93 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
94 # debug |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
95 CFLAGS="$CFLAGS -g" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
96 |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
97 if [ ".$CPP" = "." ]; then |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
98 CPP="$CC -E" |
182aee3b1bf5
Added the Clang compiler support.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
99 fi |