[cfe-dev] Clang ext_vector_type sizeof()

Steven Joubanian sjoubani at gmail.com
Thu Jul 31 19:36:07 PDT 2014


Is there any way of obtaining the declared size of a vector defined as:
	typedef float vec3 __attribute__((ext_vector_type(3)));
Using sizeof(vec3) gives 16, I assume because 4 is faster than 3, but I can't find anything which will give "3" or "12" at compile-time or runtime. Certainly sizeof(((vec3)0).x) gives me sizeof(float), but that's as far as I got.

Thanks,
S



More information about the cfe-dev mailing list