[libclc] [libclc][NFC] Fix build warning typedef-redefinition (PR #177888)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 25 16:28:05 PST 2026


https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/177888

Fix downstream build warning:
redefinition of typedef 'ushort8' is a C11 feature [-Wtypedef-redefinition]

clctypes.h re-defines typedef from opencl-c-base.h. Both files are included in libclc/opencl folder.

>From 593d8560888c925d2ce680c5d8c83017788cbc1d Mon Sep 17 00:00:00 2001
From: Wenju He <wenju.he at intel.com>
Date: Mon, 26 Jan 2026 01:15:28 +0100
Subject: [PATCH] [libclc][NFC] Fix build warning typedef-redefinition

Fix downstream build warning:
redefinition of typedef 'ushort8' is a C11 feature [-Wtypedef-redefinition]

clctypes.h re-defines typedef from opencl-c-base.h. Both files are
included in libclc/opencl folder.
---
 libclc/clc/include/clc/clctypes.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libclc/clc/include/clc/clctypes.h b/libclc/clc/include/clc/clctypes.h
index 2187c2535963b..7f3e14e6d4acd 100644
--- a/libclc/clc/include/clc/clctypes.h
+++ b/libclc/clc/include/clc/clctypes.h
@@ -9,6 +9,8 @@
 #ifndef __CLC_CLCTYPES_H_
 #define __CLC_CLCTYPES_H_
 
+#ifndef _OPENCL_BASE_H_
+
 /* 6.1.1 Built-in Scalar Data Types */
 
 typedef unsigned char uchar;
@@ -105,4 +107,6 @@ typedef __attribute__((ext_vector_type(8))) half half8;
 typedef __attribute__((ext_vector_type(16))) half half16;
 #endif
 
+#endif // _OPENCL_BASE_H_
+
 #endif // __CLC_CLCTYPES_H_



More information about the cfe-commits mailing list