[Libclc-dev] Let get_work_dim take exactly 0 arguments

Jeroen Ketema via Libclc-dev libclc-dev at lists.llvm.org
Sun Oct 1 10:23:06 PDT 2017


Without void, an arbitrary number of arguments is allowed to be passed (per the C standard). This does not seem to be the intention of the specification of this function.

Index: amdgcn/lib/workitem/get_work_dim.cl
===================================================================
--- amdgcn/lib/workitem/get_work_dim.cl	(revision 312402)
+++ amdgcn/lib/workitem/get_work_dim.cl	(working copy)
@@ -1,6 +1,6 @@
 #include <clc/clc.h>
 
-_CLC_DEF uint get_work_dim()
+_CLC_DEF uint get_work_dim(void)
 {
 	__attribute__((address_space(2))) uint * ptr =
 		(__attribute__((address_space(2))) uint *)
Index: generic/include/clc/workitem/get_work_dim.h
===================================================================
--- generic/include/clc/workitem/get_work_dim.h	(revision 312402)
+++ generic/include/clc/workitem/get_work_dim.h	(working copy)
@@ -1 +1 @@
-_CLC_DECL uint get_work_dim();
+_CLC_DECL uint get_work_dim(void);
Index: r600/lib/workitem/get_work_dim.cl
===================================================================
--- r600/lib/workitem/get_work_dim.cl	(revision 312402)
+++ r600/lib/workitem/get_work_dim.cl	(working copy)
@@ -1,6 +1,6 @@
 #include <clc/clc.h>
 
-_CLC_DEF uint get_work_dim()
+_CLC_DEF uint get_work_dim(void)
 {
 	__attribute__((address_space(7))) uint * ptr =
 		(__attribute__((address_space(7))) uint *)



More information about the Libclc-dev mailing list