Questions tagged [clang]
For questions about the clang LLVM compiler front end. For general questions about C, use the C tag.
clang
10,518
questions
1
vote
0
answers
13
views
Clang error: libdnk.a, libunwind.a and libc++.a linkage issues in windows build
I am trying to build an ELF file using the ARM-M4 toolchain version 8.1.0. My C code files compile successfully, but I encounter the following error while linking the object files
[100%] Linking C ...
1
vote
0
answers
21
views
How to add a simple RISCV intrinsic in LLVM
I have a simple scalar instruction which I added to LLVM, which takes two inputs from GPR and writes the output also to GPR. I can compile C code using inline assembly for the new instruction. I would ...
3
votes
1
answer
87
views
z/OS zero length side deck file generated, no warnings displayed
I'm trying to compile an executable on z/OS. The final step fails with a handful of undefined symbols. Presumably this is because the step before it that is generating a .so also generates a zero ...
0
votes
1
answer
57
views
ambiguous partial specializations
I have a big 3rd party library that I am trying to compile with latest clang (version 19) and I keep running into ambiguous partial specializations error. A minimal sample to reproduce the issue looks ...
0
votes
0
answers
24
views
Unable to have clang-cl use wasm-ld as the linker
I never seem to be able to get clang-cl to link with wasm-ld instead of the default lld linker.
CMakeLists.txt
cmake_minimum_required(VERSION 3.18.0)
project(wasm_test)
set(CMAKE_LINKER "C:/...
0
votes
0
answers
28
views
Standard library not detected in my custom Clang Tool
I have the following code (Want to Develop a CXX refactoring tool)
using namespace clang;
int main(int argc, const char **argv) {
static llvm::cl::OptionCategory KsaiToolOptions("my_tool ...
0
votes
0
answers
16
views
clang-tidy fails to report prefer-member-initializer correctly
I have this class constructor
struct CosseratRodPrecomputation {
CosseratRodPrecomputation(Scalar L0,
const Vec3 &xA_,
const Vec3 &...
0
votes
0
answers
32
views
Address Sanitizer do not show nothing and lsan_is_turned_off
I'm trying to use address sanitizer in my main.cpp on Windows.
Makefile:
default:
clang++ main.cpp -o app.exe -fsanitize=address -g
set ASAN_OPTIONS=detect_leaks=1
./app.exe
main.cpp
#...
0
votes
0
answers
13
views
Why does clang fail on mabi but not gcc?
Given my file test.c:
#include <stdarg.h>
int a(int b, ...) { __builtin_ms_va_list list; __builtin_ms_va_start(list,b); }
I try:
$ clang -m64 -c -g -O2 -mabi=ms test.c -Wall -Wextra
which ...
0
votes
0
answers
47
views
Clang++ issue in linkling std libraries
I'm trying to build a program using clang++, on a Ubuntu 22.04 PC.
clang version: Ubuntu clang version 14.0.0-1ubuntu1.1
gcc version 11.4.0
The SW compiles and links fine using g++ with the ...
1
vote
1
answer
70
views
gcc and clang disagree on using alias templates as template template argument [duplicate]
The code below compiles using gcc 14.1.1 but clang 18.1.8 doesn't accept it. Which one is right and is there any workaround?
template <template <typename...> class T>
struct s {
...
0
votes
1
answer
59
views
Use a lambda which captures this to initialize a struct member cause a segment fault in clang?
I use a lambda which captures this to initialize the struct member std::function f. The program is expected to print 9, but got a Segmentation fault.
My compile command is clang++ prog.cc with clang17....
7
votes
0
answers
124
views
Semantics of volatile _Atomic
Generally _Atomic does not imply semantics of volatile, i.e. operations on the atomic object are not observable side effects that the compiler needs to preserve.
As a consequence the compiler can ...
10
votes
0
answers
213
views
Semantics of volatile std::atomic<T>
Generally std::atomic<T> does not imply semantics of volatile, i.e. operations on the atomic object are not observable side effects that the compiler needs to preserve.
As a consequence the ...
2
votes
1
answer
29
views
Parse clang AST from `compile_commands.json` ignoring PCH
I'm trying to parse an AST of the whole project using a compilation database (compile_commands.json), but it contains pch files and commands related to generate those, resulting in errors during ...