llvm-project/clang/test/SemaOpenCL
Aaron Ballman 7068aa9841 Strengthen -Wint-conversion to default to an error
Clang has traditionally allowed C programs to implicitly convert
integers to pointers and pointers to integers, despite it not being
valid to do so except under special circumstances (like converting the
integer 0, which is the null pointer constant, to a pointer). In C89,
this would result in undefined behavior per 3.3.4, and in C99 this rule
was strengthened to be a constraint violation instead. Constraint
violations are most often handled as an error.

This patch changes the warning to default to an error in all C modes
(it is already an error in C++). This gives us better security posture
by calling out potential programmer mistakes in code but still allows
users who need this behavior to use -Wno-error=int-conversion to retain
the warning behavior, or -Wno-int-conversion to silence the diagnostic
entirely.

Differential Revision: https://reviews.llvm.org/D129881
2022-07-22 15:24:54 -04:00
..
access-qualifier.cl [OpenCL] Supports optional same image reads and writes in C++ for OpenCL 2021 2021-09-17 14:14:31 +01:00
address-spaces-conversions-cl2.0.cl Use functions with prototypes when appropriate; NFC 2022-03-31 13:45:39 -04:00
address-spaces.cl [clang] Reject non-declaration C++11 attributes on declarations 2022-06-15 11:58:26 +02:00
amdgpu-attrs.cl
arithmetic-conversions.cl
arm-integer-dot-product.cl Generalize calls to ImplicitlyDefineFunction 2022-04-30 10:03:51 -04:00
array-init.cl Use functions with prototypes when appropriate; NFC 2022-02-07 09:25:01 -05:00
array-parameters.cl
as_type.cl [OpenCL] Add as_size/ptrdiff/intptr/uintptr_t operators 2021-04-07 10:16:41 +01:00
atomic-init.cl
atomic-ops.cl Strengthen -Wint-conversion to default to an error 2022-07-22 15:24:54 -04:00
block-array-capturing.cl [OpaquePtrs][Clang] Add -no-opaque-pointers to tests (NFC) 2022-04-07 12:09:47 +02:00
bool-vectors.cl
builtin.cl
builtins-amdgcn-error-ci.cl
builtins-amdgcn-error-f16.cl
builtins-amdgcn-error-flat-address-space.cl
builtins-amdgcn-error-gfx9.cl
builtins-amdgcn-error-gfx10-param.cl
builtins-amdgcn-error-gfx10.cl
builtins-amdgcn-error-gfx90a-param.cl
builtins-amdgcn-error-gfx908-param.cl
builtins-amdgcn-error-gfx940-param.cl [AMDGPU] Support for gfx940 fp8 smfmac 2022-07-18 12:12:41 -07:00
builtins-amdgcn-error-vi.cl [AMDGPU] Expose __builtin_amdgcn_perm for v_perm_b32 2021-05-06 16:17:33 -07:00
builtins-amdgcn-error.cl Strengthen -Wint-conversion to default to an error 2022-07-22 15:24:54 -04:00
cl20-device-side-enqueue.cl Silence some false positive -Wstrict-prototype warnings 2022-05-13 08:31:52 -04:00
clang-builtin-version.cl Generalize calls to ImplicitlyDefineFunction 2022-04-30 10:03:51 -04:00
clk_event_t.cl Use functions with prototypes when appropriate; NFC 2022-03-31 13:45:39 -04:00
cond.cl
convergent.cl
endian-attr.cl
event_t.cl [C++4OpenCL] Add diagnostics for OpenCL types in templates. 2021-04-27 13:04:25 +01:00
event_t_overload.cl
ext_vectors.cl [Clang] Allow "ext_vector_type" applied to Booleans 2022-03-16 11:10:32 +01:00
extension-begin.cl [OpenCL] Reword unknown extension pragma diagnostic 2022-06-15 10:54:46 +01:00
extension-begin.h [OpenCL] Drop pragma handling for extension types/decls. 2021-05-17 12:09:43 +01:00
extension-version.cl [OpenCL] Reword unknown extension pragma diagnostic 2022-06-15 10:54:46 +01:00
fdeclare-opencl-builtins.cl [OpenCL] Reduce emitting candidate notes for builtins 2022-06-27 09:55:44 +01:00
features.cl [OpenCL] Define OpenCL 3.0 optional core features in C++ for OpenCL 2021 2021-09-01 10:15:17 +01:00
format-strings-fixit.cl
fp-options.cl
fp64-fp16-options.cl [OpenCL] Supports optional 64-bit floating point types in C++ for OpenCL 2021 2021-09-03 10:58:05 +01:00
func.cl Silence some false positive -Wstrict-prototype warnings 2022-05-13 08:31:52 -04:00
half.cl [OpenCL] Do not guard vload/store_half builtins 2022-05-17 10:57:23 +01:00
images.cl
init.cl
intel-subgroup-avc-ext-types.cl
invalid-assignment-constant-address-space.cl Use functions with prototypes when appropriate; NFC 2022-03-31 13:45:39 -04:00
invalid-block.cl Generalize calls to ImplicitlyDefineFunction 2022-04-30 10:03:51 -04:00
invalid-constant.cl
invalid-device-enqueue-types-cl3.0.cl [OpenCL] Add support of __opencl_c_device_enqueue feature macro. 2022-01-27 14:25:59 +03:00
invalid-image.cl [OpenCL] Fix optional image types. 2021-05-07 13:29:28 +01:00
invalid-kernel-attrs.cl
invalid-kernel-parameters.cl Recommit: Compress formatting of array type names (int [4] -> int[4]) 2021-10-21 11:34:43 -07:00
invalid-kernel.cl
invalid-pipe-builtin-cl2.0.cl Use functions with prototypes when appropriate; NFC 2022-03-31 13:45:39 -04:00
invalid-pipes-cl1.2.cl Change the behavior of implicit int diagnostics 2022-05-04 08:35:47 -04:00
invalid-pipes-cl2.0.cl Add -Wno-strict-prototypes to C tests; NFC 2022-02-24 15:30:30 -05:00
invalid-vector-literals.cl
lit.local.cfg
multistep-explicit-cast.cl
nosvm.cl Use functions with prototypes when appropriate; NFC 2022-02-07 09:25:01 -05:00
null_literal.cl [OpenCL] NULL redefined as nullptr in C++ mode. 2021-07-27 16:33:50 +01:00
null_queue.cl Use functions with prototypes when appropriate; NFC 2022-02-07 09:25:01 -05:00
numbered-address-space.cl Add prototypes to functions which need them; NFC 2022-04-01 10:32:46 -04:00
operators.cl
predefined-expr.cl Recommit: Compress formatting of array type names (int [4] -> int[4]) 2021-10-21 11:34:43 -07:00
printf-format-string-warnings.cl
printf-format-strings.cl
queue_t_overload.cl
recovery-expr.cl
sampler_t.cl Use functions with prototypes when appropriate; NFC 2022-03-31 13:45:39 -04:00
sampler_t_overload.cl
shifts.cl Use functions with prototypes when appropriate; NFC 2022-03-31 13:45:39 -04:00
sizeof.cl
storageclass-cl20.cl Use functions with prototypes when appropriate; NFC 2022-03-31 13:45:39 -04:00
storageclass.cl Use functions with prototypes when appropriate; NFC 2022-03-31 13:45:39 -04:00
str_literals.cl
to_addr_builtin.cl Generalize calls to ImplicitlyDefineFunction 2022-04-30 10:03:51 -04:00
types.cl
unroll-hint.cl
unsupported-image.cl [OpenCL] Supports optional writing to 3d images in C++ for OpenCL 2021 2021-09-20 10:07:38 +01:00
unsupported.cl [OpenCL] Fix test by adding SPIR triple 2021-05-24 13:03:50 +01:00
usm-address-spaces-conversions.cl
vec_compare.cl Use functions with prototypes when appropriate; NFC 2022-03-31 13:45:39 -04:00
vec_step.cl
vector-conv.cl
vector_inc_dec_ops.cl Use functions with prototypes when appropriate; NFC 2022-03-31 13:45:39 -04:00
vector_swizzle_length.cl Use functions with prototypes when appropriate; NFC 2022-03-31 13:45:39 -04:00
warn-missing-prototypes.cl