gcc8 Questions

5

Solved

Here is my code: #include <string.h> #include <stdio.h> typedef char BUF[8]; typedef struct { BUF b[23]; } S; S s; int main() { int n; memcpy(&s, "1234567812345678", 17); ...

1

Solved

I'm writing some code using pimpl idiom with unique_ptr. When I tried to use in-class initialization to set unique_ptr to nullptr by default, gcc gave a compile error, while clang and msvc both suc...
Apeman asked 14/10, 2019 at 11:34

3

Solved

I'm using gcc 8.2.1 and trying to build this code: std::string dir = "Documents"; char * _tempname = static_cast <char*> (malloc( dir.length() + 14)); strncpy (_tempname, dir.c_str(), dir.le...
Emia asked 21/11, 2018 at 9:7

3

Solved

Consider this simple program: #include <string> #include <sparsehash/dense_hash_map> int main() { google::dense_hash_map<std::string, int> map; map["foo"] = 0; } Compiling w...
Charlton asked 21/9, 2018 at 3:41

1

I wanted to try out the new filesystem library in C++17, so tried copying the std::filesystem::current_path example from cppreference.com and compiling it using the latest version (16.0) of the Min...
Landre asked 15/9, 2018 at 7:14

1

Solved

The following code behaves differently with or without user-defined copy constructor under GCC 8.0.1: #include <cassert> struct S { int i; int *p; S() : i(0), p(&i) {} // S(const S ...
Poniard asked 20/2, 2018 at 6:34
1

© 2022 - 2024 — McMap. All rights reserved.