This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 757
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(0) Make sure unused function warnings are always disabled. (1) Move warnings flags into a common Makefile to reduce duplication. Bug 2017697 Bug 2054216 git-commit 61716220c9a496e1b4d5d06d7d0d72b6c870e028 git-author Bryce Adelstein Lelbach aka wash <[email protected]> [git-p4: depot-paths = "//sw/gpgpu/thrust/": change = 23588928]
- Loading branch information
1 parent
3bbabdd
commit 5a0a118
Showing
4 changed files
with
91 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
ifeq ($(OS),$(filter $(OS),Linux Darwin)) | ||
ifndef USEPGCXX | ||
CUDACC_FLAGS += -Xcompiler "-Wall -Wextra -Werror" | ||
|
||
ifdef USEXLC | ||
# GCC does not warn about unused parameters in uninstantiated | ||
# template functions, but xlC does. This causes xlC to choke on the | ||
# OMP backend, which is mostly #ifdef'd out when you aren't using it. | ||
CUDACC_FLAGS += -Xcompiler "-Wno-unused-parameter" | ||
else # GCC, ICC or Clang AKA the sane ones. | ||
# XXX Enable -Wcast-align. | ||
CUDACC_FLAGS += -Xcompiler "-Winit-self -Woverloaded-virtual -Wno-cast-align -Wcast-qual -Wno-long-long -Wno-variadic-macros -Wno-unused-function" | ||
|
||
ifdef USE_CLANGLLVM | ||
IS_CLANG := 1 | ||
endif | ||
|
||
ifeq ($(OS),Darwin) | ||
IS_CLANG := 1 | ||
endif | ||
|
||
ifdef IS_CLANG | ||
# GCC does not warn about unused parameters in uninstantiated | ||
# template functions, but Clang does. This causes Clang to choke on the | ||
# OMP backend, which is mostly #ifdef'd out when you aren't using it. | ||
CUDACC_FLAGS += -Xcompiler "-Wno-unused-parameter" | ||
|
||
# -Wunneeded-internal-declaration misfires in the unit test framework | ||
# on older versions of Clang. | ||
CUDACC_FLAGS += -Xcompiler "-Wno-unneeded-internal-declaration" | ||
else # GCC | ||
ifdef CCBIN | ||
CCBIN_ENVIRONMENT := | ||
ifeq ($(OS), QNX) | ||
# QNX's GCC complains if QNX_HOST and QNX_TARGET aren't defined in the | ||
# environment. | ||
CCBIN_ENVIRONMENT := QNX_HOST=$(QNX_HOST) QNX_TARGET=$(QNX_TARGET) | ||
endif | ||
|
||
# Older versions of GCC (~4.4 and older) seem to print three version | ||
# numbers (major, minor and patch) with the -dumpversion flag; newer | ||
# versions only print two numbers. | ||
GCC_VERSION = $(shell $(CCBIN_ENVIRONMENT) $(CCBIN) -dumpversion | sed -e 's/\([0-9]\)\.\([0-9]\)\(\.[0-9]\)\?/\1\2/g') | ||
|
||
ifeq ($(shell if test $(GCC_VERSION) -lt 42; then echo true; fi),true) | ||
# In GCC 4.1.2 and older, numeric conversion warnings are not | ||
# suppressable, so shut off -Wno-error. | ||
CUDACC_FLAGS += -Xcompiler "-Wno-error" | ||
endif | ||
ifeq ($(shell if test $(GCC_VERSION) -eq 44; then echo true; fi),true) | ||
# In GCC 4.4, the CUDA backend's kernel launch templates cause | ||
# impossible-to-decipher "'<anonymous>' is used uninitialized in | ||
# this function" warnings, so disable uninitialized variable | ||
# warnings. | ||
CUDACC_FLAGS += -Xcompiler "-Wno-uninitialized" | ||
endif | ||
ifeq ($(shell if test $(GCC_VERSION) -ge 45; then echo true; fi),true) | ||
# This isn't available until GCC 4.3, and misfires on TMP code until | ||
# GCC 4.5. | ||
CUDACC_FLAGS += -Xcompiler "-Wlogical-op" | ||
endif | ||
else | ||
$(error CCBIN is not defined.) | ||
endif | ||
endif | ||
endif | ||
endif | ||
else ifeq ($(OS),win32) | ||
# XXX Enable /Wall | ||
CUDACC_FLAGS += -Xcompiler "/WX" | ||
|
||
# Disabled loss-of-data conversion warnings. | ||
# XXX Re-enable. | ||
CUDACC_FLAGS += -Xcompiler "/wd4244 /wd4267" | ||
|
||
# Suppress numeric conversion-to-bool warnings. | ||
# XXX Re-enable. | ||
CUDACC_FLAGS += -Xcompiler "/wd4800" | ||
|
||
# Disable warning about applying unary - to unsigned type. | ||
CUDACC_FLAGS += -Xcompiler "/wd4146" | ||
endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters