Questions tagged [gcc9]

GCC 9 is a major release of the GNU Compiler collection first released in 2019.

Version 9.1 was released on 2019-05-03. Version 9.3 was released on 2020-03-12.

See also:

46 questions
14
votes
1 answer

How to convert `std::filesystem::file_time_type` to a string using GCC 9

I'm trying to format the modification time of a file as a string (UTC). The following code compiles with GCC 8, but not GCC 9. #include #include #include #include #include namespace fs =…
tttapa
  • 1,397
  • 12
  • 26
8
votes
1 answer

When compiling with MINGW gcc, overloaded new operator is not called for std::string

This program (compiled with option -std=c++17) #include #include void* operator new(std::size_t nrOfBytes) { printf("allocate %zd bytes on heap\n", nrOfBytes); void* p = malloc(nrOfBytes); if (p) { return p; …
Angle.Bracket
  • 1,438
  • 13
  • 29
8
votes
1 answer

Canot read char8_t from basic_stringstream

I'm simply trying stringstream in UTF-8: #include #include #include int main() { std::basic_stringstream ss(u8"hello"); char8_t c; std::cout << (ss.rdstate() & std::ios_base::goodbit) << " " <<…
陈浩南
  • 633
  • 4
  • 12
6
votes
1 answer

uint32_t * uint32_t = uint64_t vector multiplication with gcc

I'm trying to multiply vectors of uint32_t producing the full 64-bit result in an uint64_t vector in gcc. The result I expect is for gcc to emit a single VPMULUDQ instruction. But what gcc outputs as code is horrible shuffling around of the…
Goswin von Brederlow
  • 11,875
  • 2
  • 24
  • 42
5
votes
3 answers

Is there no gcc warning when a literal declared as long is assigned to an int in c?

I can compile and run a program that assigns a long int literal, albeit it one that would fit into an int, to an int variable. $ cat assign-long-to-int.c #include int main(void){ int i = 1234L; //assign long to an int …
twisted
  • 742
  • 2
  • 11
  • 19
4
votes
1 answer

warning: taking address of packed member of 'struct details' may result in an unaligned pointer value [-Waddress-of-packed-member]

struct details_state { struct details_status D1; struct details_status D2; }; struct details { struct details_state details_states[2]; } __attribute__((packed)); struct…
qwerty
  • 85
  • 2
  • 6
4
votes
1 answer

Why number of created thread is less than thread-max?

With this code: void yield_sleep(void) { using namespace std::chrono; static size_t thread_num; auto start{high_resolution_clock::now()}; std::this_thread::yield(); auto end{high_resolution_clock::now()}; std::cout <<…
Ghasem Ramezani
  • 2,683
  • 1
  • 13
  • 32
3
votes
1 answer

Does GCC have builtins for AVX512 operations?

I was expecting to find functions like __builtin_ia32_fmaddps512 in a recent GCC to enable use of 512 bit AVX512 registers in the same way that one can use the 256 bit AVX2 registers, but they do not exist in GCC 9.2, according to the manual. Is it…
Steve Linton
  • 349
  • 4
  • 12
3
votes
1 answer

': error: ‘’ is not a member of ‘std’ ' after moving source file

Right after moving a source-file from my project to a subdirectory, gcc spit out a weird error (it did compile perfectly fine before) make[3]: Entering directory '/home/rd/Desktop/fh/bf4/bbx/o4x/server/server_app/src' CXX main.o In file…
Rielynd
  • 33
  • 5
2
votes
2 answers

How to have c++ 20 on windows?

I am working on windows 10 and currently have gcc8 installed on my system but the thing is #include cannot work with this version of gcc. So, I want to have gcc 9, but I have downloaded mingw 8 (the newest version) which probably have…
MA19
  • 510
  • 3
  • 15
2
votes
1 answer

Why /usr/lib64 is not in the default location of ld.so?

Yestoday, I tried to upgrade my gcc from version 8.4.0 to 9.3.0 by building from source, because the latest version that can be installed through apt repo of Ubuntu, is 8.4.0. Building and installing proccesses are all OK, and I can compile whatever…
Leon
  • 1,489
  • 1
  • 12
  • 31
2
votes
1 answer

c++ - double free when using std::filesystem::path in a vector

I'm working on a bare-bones file browser using DearImgui. For this i'm using std::filesystem with g++-9 and am currently testing on Kubuntu 19.04. For the most part the program works as expected. A button is used to descend into the parent directory…
Miami
  • 69
  • 1
  • 3
2
votes
1 answer

compiler error: is private within this context only on gcc9 with c++17

I test my code using travis. Recently someone added gcc9 to the set of compilers the code gets tested with. While everything compiles fine with gcc8 (both with c++14 and c++17) and gcc-9.1.0 with c++14 it fails with gcc-9.1.0 with c++17 with the…
maxbachmann
  • 2,862
  • 1
  • 11
  • 35
2
votes
1 answer

How to avoid using a global pointer variable in my GTK3 Application

I'm creating a GTK3 CHAT application with C On Linux ( Linux mint 19 right now) and I can not figure out how to avoid the use of the global (Label) pointer in the way how I designed the whole program. There is a window which has a Button, an Entry…
Michi
  • 5,175
  • 7
  • 33
  • 58
1
vote
1 answer

Overriding gcc's linker using binutil's ld

We're using GNU gcc 9.2 on Solaris 10 - we got it preconfigured from a third party. Our problem is the linker - we want to replace it with a more recent version from binutils 2.23 but this is not so easy to do. Gcc's current config: Configured with:…
raffian
  • 31,267
  • 26
  • 103
  • 174
1
2 3 4