Category "clang"

How can I achieve native-level optimizations when cross-compiling with Clang?

When cross-compiling using clang and the -target option, targeting the same architecture and hardware as the native system, I've noticed that clang seems to gen

How to Trap Floating-Point Exceptions On Rosetta 2

In a related question, How to trap floating-point exceptions on M1 Macs?, someone wanted to understand how to make the following code work natively on macOS hos

clang failed to invoke lld correctly

I prepare two very simple c files, main.c and test.c, and use the below command to compile them:clang --target=aarch64 -c main.cclang --target=aarch64 -c test.c

Get name from LLVM debug metadata

I am trying to extract source level function name form llvm debug metadata. So far, I have tried getting the pointer to DISubprogram and printing out the metada

Why is there no warning from -Wfloat-equal when comparing containers of doubles?

If I use the compiler option -Wfloat-equal with GCC or Clang, equality comparisons of float/double values cause a warning. However, when comparing containers (l

clang 14.00 : _GLIBCXX11_DEPRECATED_SUGGEST("std::bind");

Installed clang 14.0 using GNU/Guix's clang-toolchain package. I am getting depreciated feature usage error when trying to compile a simple code: //build with:

How to build llvm-hs from source

I'm working on parsing large llvm-ir code using haskell & llvm-hs for some research work. I used gllvm (comment on this post - Getting LLVM IR for a clang/c

How to use external functions in OpenModelica(linux) to call a function in the CoolProps Shared Library? Using a Fortran-77 wrapper didnt work out

I tried out the Fortran Wapper in CoolProp Sources The example fortran code given in the wrapper uses the function PropsSI in CoolProp. double precision T,Q,D,h

How to get the information of DeclRefExpr from the basic block in Clang:CFG?

How to get the information of DeclRefExpr from the basic block in Clang:CFG? This is code i have coded class CFGPrinter : public MatchFinder::MatchCallback { pu

Unresolve external symbols when using v8.dll in my project

I'm new to making C++ project. I may be not sure prerequisite knowledge of C++ project. [My environment] Windows 10 Python 2.7.18 Developer Command Prompt for V

How to get std array size in a constant expression?

Consider this code: #include <array> #include <cstddef> struct A { std::array<std::size_t, 4> test; void method() { std::size

Cannot link gmp: library not found for -lgmp

I'm trying to install fastecdsa on macOS BigSur (M1 chip) by running (venv) $ pip3 install fastecdsa and even though I previously installed gmp: $ brew install

Can a constructor affect other fields of an enclosing object, or is this a static analysis false positive?

Consider this C++ code: struct SomeStruct { SomeStruct() noexcept; }; //SomeStruct::SomeStruct() noexcept {} class SomeClass { const bool b; const SomeS

Xcode 12.5 dyld issue with binary frameworks

I have a binary Swift xcframework which references two other open-source Swift frameworks (built from source). My framework along with its dependencies are buil

Can g++ (gcc) 11 be used on Debian Bullseye?

Can g++ (gcc) 11.1 be used on Debian Bullseye? Debian 11 (bullseye) is soon to be released, and I am interested in a compiler with C++20 and modules support. De

static_assert expression is not an integral constant expression with __builtin_clz

I have the following code: typedef unsigned char uchar; constexpr int leaing_ones(uchar const u8) noexcept { return __builtin_clz(static_cast<uchar>(~s

Weird issues with Clang and C++, and uniform initialization

I was attempting to compile and run the example on this page that explores function pointers as a function input. The example I was running was the 66 line one

RISCV-vector clang causes illegal instruction in spike

I hope you can help me on my RISC-V issue. I am currently experimenting with the toolchain support for RISC-V's vector (RVV) instructions. From what I found on

macOS llvm can't find stdio.h anymore

I come to you with a weird problem I've been facing. So last week, I installed llvm and libomp for a C project, and it compiled just fine with this at the start

How to manually disable libstdc++ in CMake for Clang

Recently I'm configuring a new project in language C and C++ using both CMake and llvm Clang with Visual Studio Code for a program where EVERY exact object or l