__declspec(align) for multiple declarations

匆匆过客 提交于 2019-12-23 18:06:49

问题


Sorry for the very simple question, couldn't find a googleable answer.

Is this declaration syntax:

__declspec(align(16)) float rF[4];
__declspec(align(16)) float gF[4];
__declspec(align(16)) float bF[4];

Equivalent to this:

__declspec(align(16)) float rF[4], gF[4], bF[4];

Or will only the first variable be aligned in the latter syntax?

If it matters, these are local variables inside a global method.


回答1:


Yes. A __declspec is part of the storage class and applies to all declarators in the declaration.



来源:https://stackoverflow.com/questions/14203586/declspecalign-for-multiple-declarations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!