-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[Clang] [Sema] Make -Wincompatible-pointer-types
an error by default
#157364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-compiler-rt-sanitizer @llvm/pr-subscribers-backend-x86 Author: None (Sirraide) ChangesGCC 14 also made this an error by default, and I thought it’d make sense to follow suit. Patch is 146.31 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/157364.diff 98 Files Affected:
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index d1ef91b7e7c14..04815d064b4ea 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -58,6 +58,9 @@ C/C++ Language Potentially Breaking Changes
- The ``__has_builtin`` function now only considers the currently active target when being used with target offloading.
+- The ``-Wincompatible-pointer-types`` diagnostic now defaults to an error;
+ it can still be downgraded to a warning by passing ``-Wno-error=incompatible-pointer-types``.
+
C++ Specific Potentially Breaking Changes
-----------------------------------------
- For C++20 modules, the Reduced BMI mode will be the default option. This may introduce
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 711efbe727892..097c0b92d53dc 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -9048,7 +9048,7 @@ def ext_typecheck_convert_incompatible_pointer : ExtWarn<
"; take the address with &|"
"; remove *|"
"; remove &}3">,
- InGroup<IncompatiblePointerTypes>;
+ InGroup<IncompatiblePointerTypes>, DefaultError;
def err_typecheck_convert_incompatible_pointer : Error<
"incompatible pointer types "
"%select{%diff{assigning to $ from $|assigning to different types}0,1"
diff --git a/clang/test/APINotes/nullability.c b/clang/test/APINotes/nullability.c
index e07fc2e5c1174..4b310d4fb0068 100644
--- a/clang/test/APINotes/nullability.c
+++ b/clang/test/APINotes/nullability.c
@@ -15,7 +15,7 @@ int main() {
take_pointer_and_int(0, 0); // expected-warning{{null passed to a callee that requires a non-null argument}}
- float *fp = global_int; // expected-warning{{incompatible pointer types initializing 'float *' with an expression of type 'int * _Nonnull'}}
+ float *fp = global_int; // expected-error{{incompatible pointer types initializing 'float *' with an expression of type 'int * _Nonnull'}}
return 0;
}
diff --git a/clang/test/APINotes/nullability.m b/clang/test/APINotes/nullability.m
index 21ec6680fa714..2c32caf6260a6 100644
--- a/clang/test/APINotes/nullability.m
+++ b/clang/test/APINotes/nullability.m
@@ -11,10 +11,10 @@ int main() {
A *a;
#if SWIFT_VERSION_3_0
- float *fp = // expected-warning{{incompatible pointer types initializing 'float *' with an expression of type 'A * _Nullable'}}
+ float *fp = // expected-error{{incompatible pointer types initializing 'float *' with an expression of type 'A * _Nullable'}}
[a transform: 0 integer: 0];
#else
- float *fp = // expected-warning{{incompatible pointer types initializing 'float *' with an expression of type 'A *'}}
+ float *fp = // expected-error{{incompatible pointer types initializing 'float *' with an expression of type 'A *'}}
[a transform: 0 integer: 0]; // expected-warning{{null passed to a callee that requires a non-null argument}}
#endif
diff --git a/clang/test/APINotes/types.m b/clang/test/APINotes/types.m
index 752f102643284..9e78d406b9ed9 100644
--- a/clang/test/APINotes/types.m
+++ b/clang/test/APINotes/types.m
@@ -12,17 +12,17 @@
// CHECK-NEXT: } AnonEnumWithTypedefName
void test(OverriddenTypes *overridden) {
- int *ip1 = global_int_ptr; // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'double (*)(int, int)'}}
+ int *ip1 = global_int_ptr; // expected-error{{incompatible pointer types initializing 'int *' with an expression of type 'double (*)(int, int)'}}
- int *ip2 = global_int_fun( // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'char *'}}
- ip2, // expected-warning{{incompatible pointer types passing 'int *' to parameter of type 'double *'}}
- ip2); // expected-warning{{incompatible pointer types passing 'int *' to parameter of type 'float *'}}
+ int *ip2 = global_int_fun( // expected-error{{incompatible pointer types initializing 'int *' with an expression of type 'char *'}}
+ ip2, // expected-error{{incompatible pointer types passing 'int *' to parameter of type 'double *'}}
+ ip2); // expected-error{{incompatible pointer types passing 'int *' to parameter of type 'float *'}}
- int *ip3 = [overridden // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'char *'}}
- methodToMangle: ip3 // expected-warning{{incompatible pointer types sending 'int *' to parameter of type 'double *'}}
- second: ip3]; // expected-warning{{incompatible pointer types sending 'int *' to parameter of type 'float *'}}
+ int *ip3 = [overridden // expected-error{{incompatible pointer types initializing 'int *' with an expression of type 'char *'}}
+ methodToMangle: ip3 // expected-error{{incompatible pointer types sending 'int *' to parameter of type 'double *'}}
+ second: ip3]; // expected-error{{incompatible pointer types sending 'int *' to parameter of type 'float *'}}
- int *ip4 = overridden.intPropertyToMangle; // expected-warning{{incompatible pointer types initializing 'int *' with an expression of type 'double *'}}
+ int *ip4 = overridden.intPropertyToMangle; // expected-error{{incompatible pointer types initializing 'int *' with an expression of type 'double *'}}
}
// expected-note@SomeKit/SomeKit.h:42{{passing argument to parameter 'ptr' here}}
diff --git a/clang/test/AST/ByteCode/atomic.c b/clang/test/AST/ByteCode/atomic.c
index c8469d4a938b8..a93787ccd1e02 100644
--- a/clang/test/AST/ByteCode/atomic.c
+++ b/clang/test/AST/ByteCode/atomic.c
@@ -8,8 +8,8 @@ _Atomic int ai = 0;
// FIXME: &ai is an address constant, so this should be accepted as an
// initializer, but the bit-cast inserted due to the pointer conversion is
// tripping up the test for whether the initializer is a constant expression.
-// The warning is correct but the error is not.
-_Atomic(int *) aip3 = &ai; // both-warning {{incompatible pointer types initializing '_Atomic(int *)' with an expression of type '_Atomic(int) *'}} \
+// The first error is correct; the second is not.
+_Atomic(int *) aip3 = &ai; // both-error {{incompatible pointer types initializing '_Atomic(int *)' with an expression of type '_Atomic(int) *'}} \
// both-error {{initializer element is not a compile-time constant}}
#include <stdatomic.h>
diff --git a/clang/test/AST/ByteCode/c.c b/clang/test/AST/ByteCode/c.c
index b6d2a69271afb..6681a4f427093 100644
--- a/clang/test/AST/ByteCode/c.c
+++ b/clang/test/AST/ByteCode/c.c
@@ -349,7 +349,7 @@ const unsigned char _str2[] = {S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7]};
const int compared = strcmp(_str, (const char *)_str2); // all-error {{initializer element is not a compile-time constant}}
-const int compared2 = strcmp(strcmp, _str); // all-warning {{incompatible pointer types}} \
+const int compared2 = strcmp(strcmp, _str); // all-error {{incompatible pointer types}} \
// all-error {{initializer element is not a compile-time constant}}
int foo(x) // all-warning {{a function definition without a prototype is deprecated in all versions of C}}
diff --git a/clang/test/Analysis/OSAtomic_mac.c b/clang/test/Analysis/OSAtomic_mac.c
index 5cf7e93014323..9e3fef782de34 100644
--- a/clang/test/Analysis/OSAtomic_mac.c
+++ b/clang/test/Analysis/OSAtomic_mac.c
@@ -15,7 +15,7 @@ int *invalidSLocOnRedecl(void) {
// something like "The "compare" part of CompareAndSwap depends on an
// undefined value".
int *b;
- OSAtomicCompareAndSwapPtrBarrier(0, 0, &b); // no-crash
+ OSAtomicCompareAndSwapPtrBarrier(0, 0, (void**)&b); // no-crash
return b;
}
diff --git a/clang/test/Analysis/bsd-string.c b/clang/test/Analysis/bsd-string.c
index 93b2214786009..0c22dd0719132 100644
--- a/clang/test/Analysis/bsd-string.c
+++ b/clang/test/Analysis/bsd-string.c
@@ -137,5 +137,5 @@ void f11(void) {
int a, b;
void unknown_val_crash(void) {
// We're unable to evaluate the integer-to-pointer cast.
- strlcat(&b, a, 0); // no-crash
+ strlcat((char*)&b, a, 0); // no-crash
}
diff --git a/clang/test/Analysis/novoidtypecrash.c b/clang/test/Analysis/novoidtypecrash.c
index 5af30c2010438..325dd505a4201 100644
--- a/clang/test/Analysis/novoidtypecrash.c
+++ b/clang/test/Analysis/novoidtypecrash.c
@@ -3,7 +3,7 @@ x;
y(void **z) { // no-crash
*z = x;
int *w;
- y(&w);
+ y((void**)&w);
*w;
}
diff --git a/clang/test/Analysis/override-werror.c b/clang/test/Analysis/override-werror.c
index e84c20fc0696f..1aeed80492cca 100644
--- a/clang/test/Analysis/override-werror.c
+++ b/clang/test/Analysis/override-werror.c
@@ -5,9 +5,9 @@
// -Werror. This allows basic warnings not to interfere with producing
// analyzer results.
-char* f(int *p) {
- return p; // expected-warning{{incompatible pointer types}} \
- werror-warning{{incompatible pointer types}}
+void f(int *p) {
+ int; // expected-warning{{declaration does not declare anything}} \
+ werror-warning{{declaration does not declare anything}}
}
void g(int *p) {
diff --git a/clang/test/Analysis/uninit-vals-union.c b/clang/test/Analysis/uninit-vals-union.c
index e16cccfc9115a..3992a3a160c5e 100644
--- a/clang/test/Analysis/uninit-vals-union.c
+++ b/clang/test/Analysis/uninit-vals-union.c
@@ -1,4 +1,5 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core.builtin -verify -Wno-unused %s
+// expected-no-diagnostics
typedef union {
int y;
@@ -8,6 +9,6 @@ typedef struct { int x; } A;
void foo(void) {
U u = {};
- A *a = &u; // expected-warning{{incompatible pointer types}}
+ A *a = (A*)&u;
a->x; // no-crash
}
diff --git a/clang/test/C/C23/n3007.c b/clang/test/C/C23/n3007.c
index 34ec419b71b27..b8b84519fc19d 100644
--- a/clang/test/C/C23/n3007.c
+++ b/clang/test/C/C23/n3007.c
@@ -13,7 +13,7 @@ void test_qualifiers(int x, const int y, int * restrict z) {
static auto c = 1UL;
int* pa = &a; // expected-warning {{initializing 'int *' with an expression of type 'const int *' discards qualifiers}}
const int* pb = &b;
- int* pc = &c; // expected-warning {{incompatible pointer types initializing 'int *' with an expression of type 'unsigned long *'}}
+ int* pc = &c; // expected-error {{incompatible pointer types initializing 'int *' with an expression of type 'unsigned long *'}}
const int ci = 12;
auto yup = ci;
diff --git a/clang/test/C/C2y/n3369.c b/clang/test/C/C2y/n3369.c
index db26040d8cf44..dd3125709279d 100644
--- a/clang/test/C/C2y/n3369.c
+++ b/clang/test/C/C2y/n3369.c
@@ -100,11 +100,11 @@ void test_funcs() {
int i5[5];
char c35[3][5];
test_func_fix_fix(5, &c35, &i3, NULL);
- test_func_fix_fix(5, &c35, &i5, NULL); // expected-warning {{incompatible pointer types passing 'int (*)[5]' to parameter of type 'int (*)[3]'}}
+ test_func_fix_fix(5, &c35, &i5, NULL); // expected-error {{incompatible pointer types passing 'int (*)[5]' to parameter of type 'int (*)[3]'}}
test_func_fix_var(5, &c35, &i3, NULL);
- test_func_fix_var(5, &c35, &i5, NULL); // expected-warning {{incompatible pointer types passing 'int (*)[5]' to parameter of type 'int (*)[3]'}}
+ test_func_fix_var(5, &c35, &i5, NULL); // expected-error {{incompatible pointer types passing 'int (*)[5]' to parameter of type 'int (*)[3]'}}
test_func_fix_uns(5, &c35, &i3, NULL);
- test_func_fix_uns(5, &c35, &i5, NULL); // expected-warning {{incompatible pointer types passing 'int (*)[5]' to parameter of type 'int (*)[3]'}}
+ test_func_fix_uns(5, &c35, &i5, NULL); // expected-error {{incompatible pointer types passing 'int (*)[5]' to parameter of type 'int (*)[3]'}}
}
void test_multidimensional_arrays() {
diff --git a/clang/test/C/drs/dr0xx.c b/clang/test/C/drs/dr0xx.c
index c2b1a5b4bbecd..77ade3c351171 100644
--- a/clang/test/C/drs/dr0xx.c
+++ b/clang/test/C/drs/dr0xx.c
@@ -459,7 +459,7 @@ void dr088_1(void) {
/* Distinct type from the file scope forward declaration. */
struct dr088_t_1;
/* FIXME: this diagnostic could be improved to not be utterly baffling. */
- dr088_f((struct dr088_t_1 *)0); /* expected-warning {{incompatible pointer types passing 'struct dr088_t_1 *' to parameter of type 'struct dr088_t_1 *'}} */
+ dr088_f((struct dr088_t_1 *)0); /* expected-error {{incompatible pointer types passing 'struct dr088_t_1 *' to parameter of type 'struct dr088_t_1 *'}} */
}
void dr088_2(struct dr088_t_1 *p) { /* Pointer to incomplete type. */ }
diff --git a/clang/test/CodeGen/2008-03-05-syncPtr.c b/clang/test/CodeGen/2008-03-05-syncPtr.c
index 8968a7dc2678c..30dc4f26e1d3e 100644
--- a/clang/test/CodeGen/2008-03-05-syncPtr.c
+++ b/clang/test/CodeGen/2008-03-05-syncPtr.c
@@ -34,7 +34,7 @@ int* foo5(int** a, int* b) {
int* foo6(int** a, int*** b) {
- return __sync_lock_test_and_set (a, b);
+ return __sync_lock_test_and_set (a, (int*)b);
}
// CHECK-LABEL: define{{.*}} ptr @foo6
// CHECK: atomicrmw xchg {{.*}}, align 8
diff --git a/clang/test/CodeGen/X86/cmpccxadd-builtins-error.c b/clang/test/CodeGen/X86/cmpccxadd-builtins-error.c
index f7ecf12d0becf..d931c0eae01d4 100644
--- a/clang/test/CodeGen/X86/cmpccxadd-builtins-error.c
+++ b/clang/test/CodeGen/X86/cmpccxadd-builtins-error.c
@@ -12,5 +12,5 @@ long long test_cmpccxadd64(void *__A, long long __B, long long __C) {
}
long long test_cmpccxadd64_2(int *__A, long long __B, long long __C) {
- return _cmpccxadd_epi64(__A, __B, __C, 3); // expected-warning {{incompatible pointer types passing 'int *' to parameter of type 'long long *'}}
+ return _cmpccxadd_epi64(__A, __B, __C, 3); // expected-error {{incompatible pointer types passing 'int *' to parameter of type 'long long *'}}
}
diff --git a/clang/test/CodeGen/X86/math-builtins.c b/clang/test/CodeGen/X86/math-builtins.c
index 8a85d1f6c3a76..a56f8ba1ee385 100644
--- a/clang/test/CodeGen/X86/math-builtins.c
+++ b/clang/test/CodeGen/X86/math-builtins.c
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -o - -emit-llvm %s | FileCheck %s -check-prefix=NO__ERRNO
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -o - -emit-llvm -fmath-errno %s | FileCheck %s -check-prefix=HAS_ERRNO
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -o - -emit-llvm -disable-llvm-passes -O2 %s | FileCheck %s -check-prefix=NO__ERRNO
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -o - -emit-llvm -disable-llvm-passes -O2 -fmath-errno %s | FileCheck %s -check-prefix=HAS_ERRNO
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown-gnu -w -o - -emit-llvm -fmath-errno %s | FileCheck %s --check-prefix=HAS_ERRNO_GNU
-// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -w -o - -emit-llvm -fmath-errno %s | FileCheck %s --check-prefix=HAS_ERRNO_WIN
+// RUN: %clang_cc1 -Wno-error=incompatible-pointer-types -triple x86_64-unknown-unknown -w -o - -emit-llvm %s | FileCheck %s -check-prefix=NO__ERRNO
+// RUN: %clang_cc1 -Wno-error=incompatible-pointer-types -triple x86_64-unknown-unknown -w -o - -emit-llvm -fmath-errno %s | FileCheck %s -check-prefix=HAS_ERRNO
+// RUN: %clang_cc1 -Wno-error=incompatible-pointer-types -triple x86_64-unknown-unknown -w -o - -emit-llvm -disable-llvm-passes -O2 %s | FileCheck %s -check-prefix=NO__ERRNO
+// RUN: %clang_cc1 -Wno-error=incompatible-pointer-types -triple x86_64-unknown-unknown -w -o - -emit-llvm -disable-llvm-passes -O2 -fmath-errno %s | FileCheck %s -check-prefix=HAS_ERRNO
+// RUN: %clang_cc1 -Wno-error=incompatible-pointer-types -triple x86_64-unknown-unknown-gnu -w -o - -emit-llvm -fmath-errno %s | FileCheck %s --check-prefix=HAS_ERRNO_GNU
+// RUN: %clang_cc1 -Wno-error=incompatible-pointer-types -triple x86_64-unknown-windows-msvc -w -o - -emit-llvm -fmath-errno %s | FileCheck %s --check-prefix=HAS_ERRNO_WIN
// Test attributes and codegen of math builtins.
diff --git a/clang/test/CodeGen/arm64-microsoft-intrinsics.c b/clang/test/CodeGen/arm64-microsoft-intrinsics.c
index 51e0038b64cde..c0ff785883c71 100644
--- a/clang/test/CodeGen/arm64-microsoft-intrinsics.c
+++ b/clang/test/CodeGen/arm64-microsoft-intrinsics.c
@@ -4,14 +4,21 @@
// RUN: not %clang_cc1 -triple arm64-linux -Werror -S -o /dev/null %s 2>&1 \
// RUN: | FileCheck %s -check-prefix CHECK-LINUX
-// RUN: %clang_cc1 -triple arm64-darwin -Wno-implicit-function-declaration -fms-compatibility -emit-llvm -o - %s \
+// RUN: %clang_cc1 -triple arm64-darwin -Wno-implicit-function-declaration -fms-compatibility -emit-llvm -o - -DARM64_DARWIN %s \
// RUN: | FileCheck %s -check-prefix CHECK-MSCOMPAT
-long test_InterlockedAdd(long volatile *Addend, long Value) {
+// For some reason '_InterlockedAdd` on arm64-darwin takes an 'int*' rather than a 'long*'.
+#ifdef ARM64_DARWIN
+typedef int int32_t;
+#else
+typedef long int32_t;
+#endif
+
+long test_InterlockedAdd(int32_t volatile *Addend, long Value) {
return _InterlockedAdd(Addend, Value);
}
-long test_InterlockedAdd_constant(long volatile *Addend) {
+long test_InterlockedAdd_constant(int32_t volatile *Addend) {
return _InterlockedAdd(Addend, -1);
}
@@ -21,7 +28,7 @@ long test_InterlockedAdd_constant(long volatile *Addend) {
// CHECK-MSVC: ret i32 %[[NEWVAL:[0-9]+]]
// CHECK-LINUX: error: call to undeclared function '_InterlockedAdd'
-long test_InterlockedAdd_acq(long volatile *Addend, long Value) {
+long test_InterlockedAdd_acq(int32_t volatile *Addend, long Value) {
return _InterlockedAdd_acq(Addend, Value);
}
@@ -31,7 +38,7 @@ long test_InterlockedAdd_acq(long volatile *Addend, long Value) {
// CHECK-MSVC: ret i32 %[[NEWVAL:[0-9]+]]
// CHECK-LINUX: error: call to undeclared function '_InterlockedAdd_acq'
-long test_InterlockedAdd_nf(long volatile *Addend, long Value) {
+long test_InterlockedAdd_nf(int32_t volatile *Addend, long Value) {
return _InterlockedAdd_nf(Addend, Value);
}
@@ -41,7 +48,7 @@ long test_InterlockedAdd_nf(long volatile *Addend, long Value) {
// CHECK-MSVC: ret i32 %[[NEWVAL:[0-9]+]]
// CHECK-LINUX: error: call to undeclared function '_InterlockedAdd_nf'
-long test_InterlockedAdd_rel(long volatile *Addend, long Value) {
+long test_InterlockedAdd_rel(int32_t volatile *Addend, long Value) {
return _InterlockedAdd_rel(Addend, Value);
}
diff --git a/clang/test/CodeGen/builtin-rename.c b/clang/test/CodeGen/builtin-rename.c
index 0b71d88806237..0092e54ef37d9 100644
--- a/clang/test/CodeGen/builtin-rename.c
+++ b/clang/test/CodeGen/builtin-rename.c
@@ -4,5 +4,5 @@
int printf(const char *, ...);
int foo(void) {
- return printf(printf);
+ return printf((const char*)printf);
}
diff --git a/clang/test/CodeGen/ms-intrinsics-underaligned.c b/clang/test/CodeGen/ms-intrinsics-underaligned.c
index 34e2afb09f4b9..5be8ed8c6a600 100644
--- a/clang/test/CodeGen/ms-intrinsics-underaligned.c
+++ b/clang/test/CodeGen/ms-intrinsics-underaligned.c
@@ -111,6 +111,6 @@ long test_InterlockedAdd(X *x) {
// CHECK-AARCH64-LABEL: @test_InterlockedAdd64(
// CHECK-AARCH64: atomicrmw {{.*}} align 8
long test_InterlockedAdd64(X *x) {
- return _InterlockedAdd64(&x->c, 4);
+ return _InterlockedAdd64((volatile long long*)&x->c, 4);
}
#endif
diff --git a/clang/test/CodeGen/ubsan-pass-object-size.c b/clang/test/CodeGen/ubsan-pass-object-size.c
index b36b8bb409aef..c606d33128322 100644
--- a/clang/test/CodeGen/ubsan-pass-object-size.c
+++ b/clang/test/CodeGen/ubsan-pass-object-size.c
@@ -14,7 +14,8 @@ int foo(int *const p __attribute__((pass_object_size(0))), int n) {
// CHECK: __ubsan_handle_out_of_bounds
{
- int **p = &p; // Shadow the parameter. The pass_object_size info is lost.
+ int **q = &p;
+ int **p = q; // Shadow the parameter. The pass_object_size info is lost.
// CHECK-NOT: __ubsan_handle_out_of_bounds
x = *p[n];
}
diff --git a/clang/test/CodeGen/vla.c b/clang/test/CodeGen/vla.c
index a22ba727df2fe..18aa744b5f6fe 100644
--- a/clang/test/CodeGen/vla.c
+++ b/clang/test/CodeGen/vla.c
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -Wno-int-conversion -triple i386-unknown-unknown %s -emit-llvm -o - | FileCheck %s -check-prefixes=CHECK,NULL-INVALID
-// RUN: %clang_cc1 -Wno-int-conversion -triple i386-unknown-unknown %s -emit-llvm -fno-delete-null-pointer-checks -o - | FileCheck %s -check-prefixes=CHECK,NULL-VALID
+// RUN: %clang_cc1 -Wno-error=incompatible-pointer-types -Wno-int-conversion -triple i386-unknown-unknown %s -emit-llvm -o - | File...
[truncated]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but let's see if other people have opinions in the next few days.
That GCC did it first and did not get pushback is reassuring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes sense, and if GCC hasn't gotten a huge amount of pushback, then there is no reason for us not to do this.
✅ With the latest revision this PR passed the C/C++ code formatter. |
IIRC the Clang behaviour for |
Sort of: while |
Ah, I see. Thanks! |
Looks like this is causing errors in llvm-testsuite, but I’m candidly not sure how this is usually handled: |
I think we'll want to add |
Thanks; I’ll look into it. |
Should be fixed by llvm/llvm-test-suite@8a20f8c unless more tests start failing. |
Update, there’ve been a few more, so I’m doing the same thing Aaron did and fixing them one at a time as the bot detects the failures (because I’m pretty sure waiting for the test suite to run on my system would take a lot longer...). |
@medismailben @Sirraide This seems to have broken several tests several tests in the LLDB test suite: |
Weird, I’m pretty sure I ran the LLDB tests locally and didn’t observe any errors; I’m looking into it. |
Should be fixed by #158756. |
@Sirraide Thanks, feel free to merge whenever |
InvalidAtomicBuiltins.cl requires an update after llvm/llvm-project#157364 Signed-off-by: Sidorov, Dmitry <[email protected]>
Fix another test impacted by llvm#157364. On Windows, `GetComputerNameA()`, which is what this ends up calling, takes an `LPDWORD`, but we were handing it an `int*`; fix this by declaring it as a `DWORD` instead.
… some tests (llvm#158756) These no longer compile because the warning now defaults to an error after llvm#157364, so downgrade the error to a warning for now; I’m not familiar enough with either LLDB or MacOS to fix these warnings properly (assuming they’re unintended).
llvm#157364) GCC 14 also made this an error by default, so we’re following suit. Fixes llvm#74605
Fix another test impacted by llvm#157364. On Windows, `GetComputerNameA()`, which is what this ends up calling, takes an `LPDWORD`, but we were handing it an `int*`; fix this by declaring it as a `DWORD` instead.
… some tests (llvm#158756) These no longer compile because the warning now defaults to an error after llvm#157364, so downgrade the error to a warning for now; I’m not familiar enough with either LLDB or MacOS to fix these warnings properly (assuming they’re unintended).
llvm#157364) GCC 14 also made this an error by default, so we’re following suit. Fixes llvm#74605
Fix another test impacted by llvm#157364. On Windows, `GetComputerNameA()`, which is what this ends up calling, takes an `LPDWORD`, but we were handing it an `int*`; fix this by declaring it as a `DWORD` instead.
… some tests (llvm#158756) These no longer compile because the warning now defaults to an error after llvm#157364, so downgrade the error to a warning for now; I’m not familiar enough with either LLDB or MacOS to fix these warnings properly (assuming they’re unintended).
InvalidAtomicBuiltins.cl requires an update after llvm/llvm-project#157364 Signed-off-by: Sidorov, Dmitry <[email protected]> Original commit: KhronosGroup/SPIRV-LLVM-Translator@28fc4d6306e812c
GCC 14 also made this an error by default, and I thought it’d make sense to follow suit.
Fixes #74605