clang

CMake Error: Could not create named generator XCode

亡梦爱人 提交于 2021-01-26 21:39:43
问题 i have checked out llvm/clang/compiler-rt sources from official git repositories, but i'm having: MBA-Anton:llvm_34_xcode_build asmirnov$ cmake -G XCode ../llvm_34 CMake Error: Could not create named generator XCode LLVM sources: MBA-Anton:llvm_34_xcode_build asmirnov$ ls ../llvm_34 CMakeLists.txt Makefile.common cmake llvm.spec.in CODE_OWNERS.TXT Makefile.config.in configure projects CREDITS.TXT Makefile.rules docs test LICENSE.TXT README.txt examples tools LLVMBuild.txt autoconf include

CMake Error: Could not create named generator XCode

不羁岁月 提交于 2021-01-26 21:38:34
问题 i have checked out llvm/clang/compiler-rt sources from official git repositories, but i'm having: MBA-Anton:llvm_34_xcode_build asmirnov$ cmake -G XCode ../llvm_34 CMake Error: Could not create named generator XCode LLVM sources: MBA-Anton:llvm_34_xcode_build asmirnov$ ls ../llvm_34 CMakeLists.txt Makefile.common cmake llvm.spec.in CODE_OWNERS.TXT Makefile.config.in configure projects CREDITS.TXT Makefile.rules docs test LICENSE.TXT README.txt examples tools LLVMBuild.txt autoconf include

Concise way to disable specific warning instances in Clang

两盒软妹~` 提交于 2021-01-24 07:02:50
问题 Suppose there is some warning in my code, e.g. that Clang has added padding to a struct. I am find with that particular instance and I want to mark it as "Noted; don't warn me about this instance again". Is there a way to do this that isn't insanely verbose (i.e. #pragma clang diagnostic push etc)? Ideally something like a comment on the same line as the warning, something like this: // clang(-Wno-padded) To be clear, I only want to suppress one specific instance of the warning (which

Concise way to disable specific warning instances in Clang

我只是一个虾纸丫 提交于 2021-01-24 06:56:12
问题 Suppose there is some warning in my code, e.g. that Clang has added padding to a struct. I am find with that particular instance and I want to mark it as "Noted; don't warn me about this instance again". Is there a way to do this that isn't insanely verbose (i.e. #pragma clang diagnostic push etc)? Ideally something like a comment on the same line as the warning, something like this: // clang(-Wno-padded) To be clear, I only want to suppress one specific instance of the warning (which

Concise way to disable specific warning instances in Clang

ぐ巨炮叔叔 提交于 2021-01-24 06:56:08
问题 Suppose there is some warning in my code, e.g. that Clang has added padding to a struct. I am find with that particular instance and I want to mark it as "Noted; don't warn me about this instance again". Is there a way to do this that isn't insanely verbose (i.e. #pragma clang diagnostic push etc)? Ideally something like a comment on the same line as the warning, something like this: // clang(-Wno-padded) To be clear, I only want to suppress one specific instance of the warning (which

GCC:优化 Linux、互联网和一切

 ̄綄美尐妖づ 提交于 2021-01-23 09:05:21
软件如果不能被电脑运行,那么它就是无用的。而在处理运行时run-time性能的问题上,即使是最有才华的开发人员也会受编译器的支配 —— 因为如果没有可靠的编译器工具链,就无法构建任何重要的东西。GNU 编译器集合GNU Compiler Collection(GCC)提供了一个健壮、成熟和高性能的工具,以帮助你充分发挥你代码的潜能。经过数十年成千上万人的开发,GCC 成为了世界上最受尊敬的编译器之一。如果你在构建应用程序是没有使用 GCC,那么你可能错过了最佳解决方案。 根据 LLVM.org 的说法,GCC 是“如今事实上的标准开源编译器” [1] ,也是用来构建完整系统的基础 —— 从内核开始。GCC 支持超过 60 种硬件平台,包括 ARM、Intel、AMD、IBM POWER、SPARC、HP PA-RISC 和 IBM Z,以及各种操作环境,包括 GNU、Linux、Windows、macOS、FreeBSD、NetBSD、OpenBSD、DragonFly BSD、Solaris、AIX、HP-UX 和 RTEMS。它提供了高度兼容的 C/C++ 编译器,并支持流行的 C 库,如 GNU C Library(glibc)、Newlib、musl 和各种 BSD 操作系统中包含的 C 库,以及 Fortran、Ada 和 GO 语言的前端。GCC

以B站C语言视频为基础的课后总结

牧云@^-^@ 提交于 2021-01-21 08:54:21
初识C语言 一,什么是C语言? 1.C语言是一门计算机语,人和计算机交流的语言 2.高级编程语言还有C/C++/JAVA/python..... 3.计算机是硬件是由01二进制实现信息的交流和储存的 4.国际标准ANSI C C89/90 5.C99/C11并不流行,很少编译器支持 6.编译器主要有Clang、GCC、WIN-TC、SUBLIME、MSVC(vs的编译器)、Turbo C等。 二,第一个程序 #include<stdio.h> int 是整形的意思 main()是主函数 因为(返回值)return 0;0,是整形,所以前面要加 返回类型int 连起来就是int main() 还可以这样写,但是已经过时了,不推荐 //是注释当前所在行代码 还可以使用/ 内容 / 例: 三,变量类型//所占空间大小单位是字节//变量类型不占空间 字节是计算机的储存单位 计算机的最小储存单位是比特bit bit位 只储存 0 1两个二进制数 1 字节是 8 bit char //字符数据类型//1//ASCII码值表示对应字符 short //短整型//2//short int int //整形//4//整数 long //长整型//4/8(取决于是32位平台还是64位平台的机器) long long //更长的整形//8 float //单精度浮点数//4//小数 double /

How can I align function parameter names in clang-format?

青春壹個敷衍的年華 提交于 2021-01-19 05:04:24
问题 Is it possible to use clang-format to format struct members and function parameter names into columns? For example: struct { int alpha; //aligned to 'b' of "beta" unsigned int beta; MyObject *gamma; //aligned with 'g' not '*' }; void foobar (int alpha, //aligned to 'b' of "beta" unsigned int beta MyObject *gamma) //aligned with 'g' not '*' { } If it's not possible, could I extend clang-format somehow to achieve this? 回答1: Well, you can get close. For function declarations: You can set

C++ 跨平台开发遇到的问题

旧城冷巷雨未停 提交于 2021-01-06 04:27:14
我们维护一个 C++ 编写的滤镜和特效库,可跨平台运行在 Windows、iOS、Android 上。Windows 上使用 Visual Studio 2013 或 2017 编译,iOS 是 Xcode 带的 clang,Android 使用 gcc。 抛开 iOS 和 Android 的平台差异,只从 C++ 语言来看,clang 和 gcc 的行为是很相似的,一个移动端编译运行没有问题,另一个就基本没有问题。但 VS 编译器的表现却很不同。此文对比 VS 编译器和 clang 编译器的一些差异,顺便记录我们踩过的坑。 1. 字符编码 在我的开发环境,clang 编码默认是 utf8, VS 是 GB2312(代码页是 936),它们都兼容 ASCII。 假如代码文件中只出现英文,两端都可编译。假如代码中出现中文,文件编码为 utf8, iOS 编译没有问题,VS 会出现编译错误 error C2001。假如设置编码为 utf16, VS 编译没有问题,而 iOS 会出现编译错误 encoding is not supported。因此假如代码有中文,需要将源文件编码修改为 Unicode(UTF8 带签名)- 代码页 65001。 参见 vs编译 error C2001: 常量中有换行符 中文无法通过编译 另外假如包含中文字符串,直接读取使用,程序运行起来很容易出现乱码

What does the clang compiler's `-Weverything` option include and where is it documented?

╄→尐↘猪︶ㄣ 提交于 2021-01-01 09:59:48
问题 clang, but NOT gcc, has a -Weverything option which appears to include things such as -Wpedantic . You can test it here: https://godbolt.org/z/qcYKd1. See the top-right of the window for where I have typed in -Weverything as an explicit compiler option. Notice the -Wvla-extension warning we get since we are relying on a C99 extension in C++ in this case, and we have -Weverything set. We get the same warning if we just use -Wpedantic , as shown here: https://godbolt.org/z/M9ahE4, indicating