What is GCC_NO_COMMON_BLOCKS used for?

回眸只為那壹抹淺笑 提交于 2019-12-18 03:49:08

问题


I found that my project sets

GCC_NO_COMMON_BLOCKS = NO 

under Apple LLVM Compiler 3.1 - Code Generation settings, as "No Common Blocks"

I would like to know: what is that flag used for?

Thanks a lot


回答1:


From Xcode's quick help:

In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks. This has the effect that if the same variable is declared (without extern ) in two different compilations, you will get an error when you link them. The only reason this might be useful is if you wish to verify that the program will work on other systems which always work this way.

You can find the quick help in the right pane, under the "Show Quick Help Inspector" tab:



来源:https://stackoverflow.com/questions/11233235/what-is-gcc-no-common-blocks-used-for

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