Why does OpenBSD's G++ make system headers default to C linkage?

て烟熏妆下的殇ゞ 提交于 2019-12-06 07:28:18

Recently came across the same issue when working with a freestanding cross compiler.

It seems G++ will do this when targeting "old" systems as indicated here:

http://tigcc.ticalc.org/doc/cpp.html#SEC9a

On very old systems, some of the pre-defined system header directories get even more special treatment. GNU C++ considers code in headers found in those directories to be surrounded by an extern "C" block. There is no way to request this behavior with a #pragma, or from the command line.

Hope this may provide some insight to future travelers here.

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