clang++ Questions
0
Source code:
#include <cstdio>
static const char encodeBase64Table[64 + 1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int main() {
// create decoding t...
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...
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...
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...
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 ...
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...
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...
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...
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...
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 ...
1
Solved
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...
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...
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...
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...
© 2022 - 2024 — McMap. All rights reserved.