简体   繁体   English

将OSX Clang配置为包含语句区分大小写

[英]Configure OSX Clang to be case sensitive to include statements

I know that case sensitivity in C++ include statements is a file system issue (related questions here and here ). 我知道C ++中的区分大小写包含语句是一个文件系统问题( 这里这里有相关问题)。

Is it possible to configure Clang to require case sensitive matches to prevent cross platform build issues? 是否可以将Clang配置为需要区分大小写的匹配以防止跨平台构建问题?

Clang now has these warning flags: Clang现在有这些警告标志:

-Wnonportable-include-path
-Wnonportable-system-include-path

The first is for quoted includes and the second is for angle bracket includes. 第一个用于引用包含,第二个用于角括号包括。 They can even be mapped to errors: 它们甚至可以映射到错误:

-Werror=nonportable-include-path
-Werror=nonportable-system-include-path

Presumably, they're not enabled by default because they can slow down the compile. 据推测,默认情况下它们不会启用,因为它们会降低编译速度。 I haven't taken the time to investigate just how much. 我没有花时间去调查多少钱。

Well, as you stated, and as those questions stated, it's a file system issue. 好吧,正如你所说,并且正如那些问题所述,这是一个文件系统问题。 If you formatted your OS X drive as case-sensitive, then it might work, but really you should probably find a different way of differentiating headers. 如果您将OS X驱动器格式化为区分大小写,那么它可能会起作用,但实际上您应该找到区分标头的不同方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM