CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
54 lines
2.3 KiB
C
54 lines
2.3 KiB
C
// RUN: %clang_cc1 -Wformat %s -verify
|
|
// RUN: %clang_cc1 -Wformat -std=c23 %s -verify
|
|
// RUN: %clang_cc1 -xc++ -Wformat %s -verify
|
|
// RUN: %clang_cc1 -xobjective-c -Wformat -fblocks %s -verify
|
|
// RUN: %clang_cc1 -xobjective-c++ -Wformat -fblocks %s -verify
|
|
// RUN: %clang_cc1 -std=c23 -Wformat %s -pedantic -verify=expected,pedantic
|
|
// RUN: %clang_cc1 -xc++ -Wformat %s -pedantic -verify=expected,pedantic
|
|
// RUN: %clang_cc1 -xobjective-c -Wformat -fblocks -pedantic %s -verify=expected,pedantic
|
|
|
|
__attribute__((__format__(__printf__, 1, 2)))
|
|
int printf(const char *, ...);
|
|
__attribute__((__format__(__scanf__, 1, 2)))
|
|
int scanf(const char *, ...);
|
|
|
|
void f(void *vp, const void *cvp, char *cp, signed char *scp, int *ip) {
|
|
int arr[2];
|
|
|
|
printf("%p", cp);
|
|
printf("%p", cvp);
|
|
printf("%p", vp);
|
|
printf("%p", scp);
|
|
printf("%p", ip); // pedantic-warning {{format specifies type 'void *' but the argument has type 'int *'}}
|
|
printf("%p", arr); // pedantic-warning {{format specifies type 'void *' but the argument has type 'int *'}}
|
|
|
|
scanf("%p", &vp);
|
|
scanf("%p", &cvp);
|
|
scanf("%p", (void *volatile*)&vp);
|
|
scanf("%p", (const void *volatile*)&cvp);
|
|
scanf("%p", &cp); // pedantic-warning {{format specifies type 'void **' but the argument has type 'char **'}}
|
|
scanf("%p", &ip); // pedantic-warning {{format specifies type 'void **' but the argument has type 'int **'}}
|
|
scanf("%p", &arr); // expected-warning {{format specifies type 'void **' but the argument has type 'int (*)[2]'}}
|
|
|
|
#if !__is_identifier(nullptr)
|
|
typedef __typeof__(nullptr) nullptr_t;
|
|
nullptr_t np = nullptr;
|
|
nullptr_t *npp = &np;
|
|
|
|
printf("%p", np);
|
|
scanf("%p", &np); // expected-warning {{format specifies type 'void **' but the argument has type 'nullptr_t *'}}
|
|
scanf("%p", &npp); // pedantic-warning {{format specifies type 'void **' but the argument has type 'nullptr_t **'}}
|
|
#endif
|
|
|
|
#ifdef __OBJC__
|
|
id i = 0;
|
|
void (^b)(void) = ^{};
|
|
|
|
printf("%p", i); // pedantic-warning {{format specifies type 'void *' but the argument has type 'id'}}
|
|
printf("%p", b); // pedantic-warning {{format specifies type 'void *' but the argument has type 'void (^)(void)'}}
|
|
scanf("%p", &i); // pedantic-warning {{format specifies type 'void **' but the argument has type 'id *'}}
|
|
scanf("%p", &b); // pedantic-warning {{format specifies type 'void **' but the argument has type 'void (^*)(void)'}}
|
|
#endif
|
|
|
|
}
|