diff options
author | Jakub Jelinek <jakub@redhat.com> | 2023-04-20 19:26:17 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2023-04-20 19:29:57 +0200 |
commit | 3d7ab53d6c59499624aa41c8dea0664976820b3b (patch) | |
tree | 54699a7583004ec4aee9a6b240f09306623654ab /gcc/cp/tree.cc | |
parent | 1d2aa9a8cb8fd078af930347392cfdfc14e1551c (diff) | |
download | gcc-3d7ab53d6c59499624aa41c8dea0664976820b3b.zip gcc-3d7ab53d6c59499624aa41c8dea0664976820b3b.tar.gz gcc-3d7ab53d6c59499624aa41c8dea0664976820b3b.tar.bz2 |
c: Avoid -Wenum-int-mismatch warning for redeclaration of builtin acc_on_device [PR107041]
The new -Wenum-int-mismatch warning triggers with -Wsystem-headers in
<openacc.h>, for obvious reasons the builtin acc_on_device uses int
type argument rather than enum which isn't defined yet when the builtin
is created, while the OpenACC spec requires it to have acc_device_t
enum argument. The header makes sure it has int underlying type by using
negative and __INT_MAX__ enumerators.
I've tried to make the builtin typegeneric or just varargs, but that
changes behavior e.g. when one calls it with some C++ class which has
cast operator to acc_device_t, so the following patch instead disables
the warning for this builtin.
2023-04-20 Jakub Jelinek <jakub@redhat.com>
PR c/107041
* c-decl.cc (diagnose_mismatched_decls): Avoid -Wenum-int-mismatch
warning on acc_on_device declaration.
* gcc.dg/goacc/pr107041.c: New test.
Diffstat (limited to 'gcc/cp/tree.cc')
0 files changed, 0 insertions, 0 deletions