diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-10 14:11:51 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-10 14:11:51 -0300 |
| commit | f79ccdca9bbe9d486d91a44a4464b99ce38de0e2 (patch) | |
| tree | 5c7b75c6fa8d3176d452db1d2a813d3aedf09e98 | |
| parent | 4e47f81188d37e29027158b76271d02a781242e2 (diff) | |
| download | lua-f79ccdca9bbe9d486d91a44a4464b99ce38de0e2.tar.gz lua-f79ccdca9bbe9d486d91a44a4464b99ce38de0e2.tar.bz2 lua-f79ccdca9bbe9d486d91a44a4464b99ce38de0e2.zip | |
Eases the use of clang in the makefile
New definition in the makefile for warnings that are valid for gcc but
not for clang (CWARNGCC).
| -rw-r--r-- | makefile | 13 |
1 files changed, 9 insertions, 4 deletions
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | # Warnings valid for both C and C++ | 6 | # Warnings valid for both C and C++ |
| 7 | CWARNSCPP= \ | 7 | CWARNSCPP= \ |
| 8 | -fmax-errors=5 \ | 8 | -Wfatal-errors \ |
| 9 | -Wextra \ | 9 | -Wextra \ |
| 10 | -Wshadow \ | 10 | -Wshadow \ |
| 11 | -Wsign-compare \ | 11 | -Wsign-compare \ |
| @@ -14,8 +14,6 @@ CWARNSCPP= \ | |||
| 14 | -Wredundant-decls \ | 14 | -Wredundant-decls \ |
| 15 | -Wdisabled-optimization \ | 15 | -Wdisabled-optimization \ |
| 16 | -Wdouble-promotion \ | 16 | -Wdouble-promotion \ |
| 17 | -Wlogical-op \ | ||
| 18 | -Wno-aggressive-loop-optimizations \ | ||
| 19 | # the next warnings might be useful sometimes, | 17 | # the next warnings might be useful sometimes, |
| 20 | # but usually they generate too much noise | 18 | # but usually they generate too much noise |
| 21 | # -Werror \ | 19 | # -Werror \ |
| @@ -26,6 +24,13 @@ CWARNSCPP= \ | |||
| 26 | # -Wformat=2 \ | 24 | # -Wformat=2 \ |
| 27 | # -Wcast-qual \ | 25 | # -Wcast-qual \ |
| 28 | 26 | ||
| 27 | |||
| 28 | # Warnings for gcc, not valid for clang | ||
| 29 | CWARNGCC= \ | ||
| 30 | -Wlogical-op \ | ||
| 31 | -Wno-aggressive-loop-optimizations \ | ||
| 32 | |||
| 33 | |||
| 29 | # The next warnings are neither valid nor needed for C++ | 34 | # The next warnings are neither valid nor needed for C++ |
| 30 | CWARNSC= -Wdeclaration-after-statement \ | 35 | CWARNSC= -Wdeclaration-after-statement \ |
| 31 | -Wmissing-prototypes \ | 36 | -Wmissing-prototypes \ |
| @@ -35,7 +40,7 @@ CWARNSC= -Wdeclaration-after-statement \ | |||
| 35 | -Wold-style-definition \ | 40 | -Wold-style-definition \ |
| 36 | 41 | ||
| 37 | 42 | ||
| 38 | CWARNS= $(CWARNSCPP) $(CWARNSC) | 43 | CWARNS= $(CWARNSCPP) $(CWARNSC) $(CWARNGCC) |
| 39 | 44 | ||
| 40 | # Some useful compiler options for internal tests: | 45 | # Some useful compiler options for internal tests: |
| 41 | # -DLUAI_ASSERT turns on all assertions inside Lua. | 46 | # -DLUAI_ASSERT turns on all assertions inside Lua. |
