clang++ Questions

0

Source code: #include <cstdio> static const char encodeBase64Table[64 + 1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; int main() { // create decoding t...
Skindeep asked 18/1, 2023 at 0:55

2

Recently, I wanted to use from_chars from c++17. Looked at http://en.cppreference.com/w/cpp/utility/from_chars and found that code on this page: #include <iostream> #include <charconv>...
Selfsustaining asked 3/4, 2018 at 22:5

1

After routine upgrade Ubuntu, my system build failed. It is using gcc 14 now, and I guess it wants 13? I tried following the instructions here but I don't know how to do syslink Please give me a st...
Mortonmortuary asked 29/11, 2022 at 8:11

2

Solved

I compiled the following c++ program: int main() { 2==3; } with: clang++-5.0 -std=c++17 -Wunused-comparison prog.cpp and got the warning: warning: equality comparison result unused [-Wunus...
Cursorial asked 7/4, 2019 at 14:7

3

Solved

My problem I have 2 adjacent buffers of bytes of identical size (around 20 MB each). I just want to count the differences between them. My question How much time this loop should take to run on a 4...
Inferno asked 12/11, 2022 at 18:40

1

Solved

Consider this example: #include <iostream> std::string& fn(std::string& str) { str = "oh no!"; return str; } int main() { std::string str = fn(str); std::cout &l...
Jecon asked 24/10, 2022 at 5:7

2

Solved

This works: (A) class Foo { public: const bool b; constexpr ~Foo() = default; constexpr Foo(const bool b) : b(b) {}; }; class Bar { public: static constexpr Foo tru { true };//Foo is complete ...
Heavyduty asked 22/10, 2022 at 13:57

2

Solved

on ubuntu 20.04, when I use clang-8 or clang-9 (clang version 9.0.1-12) to compile a simple code containing reference to libm, it will fail with error "undefined reference to __pow_finite" #includ...
Midway asked 11/6, 2020 at 22:15

5

Solved

g++ (GCC) 5.2.0 clang version 3.7.1 (tags/RELEASE_371/final) GNU gdb (GDB) 7.12 Gdb is unable to locate the definition of std::string when compiled with clang for some reason. I have custom comp...
Sedentary asked 19/1, 2017 at 15:24

1

I've been trying to locate where a segmentation fault is in a program using LLDB. I've been going to the Ubuntu shell on repl.it and compiling my code using clang++-7 -pthread -std=c++17 -o main ma...
Enterprising asked 22/9, 2021 at 20:54

1

I ran into a strange situation that alignof(__m512) is not equal to std::alignment_of<__m512>::value compiled by Apple's clang. After some testing I found that when alignof(T) is evaluated in...
Marlenmarlena asked 10/9, 2020 at 20:15

3

Solved

I am trying to sort photos in chronological order. Therefore I extract the time as a string from the EXIF data, which I then convert to std::time_t. However I sometimes get an incorrect result. I h...
Manyplies asked 4/9, 2017 at 6:56

1

My current file structure is: ├── common │   └── example.cc ├── compile_commands.json ├── include    └── common    └── example.hh example.hh: Leave it blank example.cc: #include "common/exa...
Oncoming asked 8/9, 2020 at 5:30

2

Clang has various sanitizers that can be turned on to catch problems at runtime. However, there are some sanitizers that I can't use together. Why is that? clang++-3.9 -std=c++1z -g -fsanitize=me...
Identical asked 1/5, 2016 at 21:2

3

Solved

There is no file called bits/c++config.h in the c++ include directory which is required by the cstring header file. But when I include the the header cstring and compile with g++, it does not give ...
Glossa asked 8/2, 2012 at 21:14

1

Solved

I have a CMake project with several subprojects that create static libraries built with -flto=thin. The project has a lot of tests that are linked against the aforementioned libraries. With LTO it ...
Hepzi asked 10/5, 2022 at 17:2

1

Solved

Supposing I have a C++ code already written and I want to generate a clang-format file from it, in order to note all the format settings of my code in this file, is there a way of doing it?
Dubbin asked 17/12, 2021 at 20:40

2

Solved

I've been trying to use the std::format function included in C++20. As far as I can tell, clang 14 is supposed to support this feature, but for some reason I am receiving the following error: no me...
Tushy asked 7/4, 2022 at 6:53

1

Solved

I stumbled upon a strange compile error in Clang-12. The code below compiles just fine in GCC 9. Is this a bug in the compiler or is there an actual problem with my code and GCC is just too forgivi...
Plainclothesman asked 18/3, 2022 at 22:9

4

I have a warning in my C++11 code that I would like to fix correctly but I don't really know how. I have created my own exception class that is derived from std::runtime_error: class MyError : pub...
Luing asked 15/8, 2018 at 17:28

1

I'm trying to use Google's Address Sanitizer with a CUDA project, more precisely with OpenCV cuda functions. However I got an 'out of memory' error on the first cuda call. OpenCV Error: Gpu API ca...
Sunken asked 21/5, 2015 at 13:5

3

I would like to use llvm control flow integrity and I used the clang+llvm binary packaged version 7.0.1 shipped for Ubuntu 14.04. When I use clang++ with options '-fsanitize=cfi -flto -fvisibility=...
Officinal asked 11/2, 2019 at 21:24

1

Consider the following code: #include <any> struct A { A(); A(const A&) = default; explicit A(std::any value); }; struct B: A { B() : A() { } B(const B& b) : A(b) {} explicit...
Spineless asked 11/3, 2019 at 17:37

2

Cppreference mentions function current_zone() as part of the timezone implementation in <chrono>. Has this feature been implemented in GCC or Clang? I would like to test it in one of the onli...
Spiegeleisen asked 25/1, 2022 at 17:14

5

Solved

I can't compile with -std=c++17, I got : error: invalid value 'c++17' in '-std=c++17' However I update Xcode and clang. My Clang version is: Configured with: --prefix=/Applications/Xcode.app/...
Caboodle asked 25/1, 2018 at 14:25

© 2022 - 2024 — McMap. All rights reserved.