Learncado
Learncado

Learncado brings together a vast collection of questions and answers. Expand your knowledge, learn new skills, and find solutions to your queries effortlessly. Enhance your learning experience and save valuable time by exploring our website today.

Resources

  • Questions
  • Question By Tags

Help and support

  • Contact
  • About

  • Geniecourse
  • Jetsodeals
  • Rentcado
  • Dealcado
© 2021-2023 Learncado All Rights Reserved.

Search Results (88)

Results for gcc

December 7th, 2023
GCC warning for unintended pointer arithmetic on string literals

With the constant chopping and changing back and forth between different languages, every now and then I find myself trying to write fragments of Pyth...

cgccc++gcc-warning
Read more
December 7th, 2023
Why does this code print different values compiled by clang and gcc?

asm.s: .intel_syntax noprefix .global Foo Foo: mov ax, 146 ret main.c: #include extern int Foo(void); int main(int argc, char** args){ ...

cassemblyx86-64calling-convention
Read more
November 29th, 2023
Overriding a method returning a reference to an array does not work in gcc, but works in clang/icx

I want to return a reference to an array in C++. I am referring to the getColor2 member function and its overrides in the example below. I have a pure...

gccc++clang++
Read more
November 23rd, 2023
Partial template specialization constrained by std::derived_from compiles differently by MSVC and GCC

#include class Base {}; class Derived : public Base {}; // primary template template typename T> requires std::derived_from struct C { sta...

c++language-lawyerc++20
Read more
November 21st, 2023
gcc -fno-stack-protector is not working, how to fix it?

I am trying to mock a C stack overflow using strcpy like this: #include int main() { char str[10]; strcpy(str, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

cgccoverflow
Read more
November 18th, 2023
Ambiguous template instantiation in GCC

Why does the code below compile with MSVC2022, but not with GCC 12? #include template auto value> class getter; template class T, class ReturnType,...

gccc++
Read more
November 10th, 2023
arm gcc: store-store ordering without volatile?

I am trying to use a shared index to indicate that data has been written to a shared circular buffer. Is there an efficient way to do this on ARM (arm...

gccvolatileatomicarmmemory-barriers
Read more
December 5th, 2023
C++: `error: expected ',' or '...' before string constant` before `__FILE__` in `fancy_abort (__FILE__, __LINE__, __FUNCTION__)` when compiling gcc

This is a continuation of trying to compile a license-free GPL version of the Microchip XC32 microcontroller g++ XC32 v4.35 cross-compiler from source...

gccc++mingw-w64msys2
Read more
November 4th, 2023
Msvc compiles &(Class::mem) but gcc does not

I have recently learnt about pointer to member syntax and then wrote the program shown below that msvc compiles but gcc and clang rejects. #include #...

c++language-lawyer
Read more
November 4th, 2023
Why does GCC copy object for each comparison in `std::ranges::max`?

Consider the following example (Godbolt): #include #include #include #include struct A { A() {} A( const A& ) { std::cout "Copy\n"; } ...

gccc++stlclangstd-ranges
Read more
November 1st, 2023
pthread_setschedparam not working on GCC with mingw64

I'm trying to run the example code from here on Windows 11 with GCC v13.2.0 installed (MSYS2, UCRT runtime): #include #include #include #include #...

gccc++multithreadingmingw-w64pthreads
Read more
October 24th, 2023
How to compile for riscv zicond extension in gcc?

I wanted to use zicond extension for risc-v architecture. I read those messages. I couldn't understand how to compile for zicond extension. I tried in...

gccriscvinstruction-set
Read more
October 22nd, 2023
Force GCC to always load a const (i.e. read-only) even with optimizations enabled

Let's say I have a const global variable that is, therefore, read-only and will be placed in the .rodata section. I'm compiling the code with -O3 opti...

cconstantsoptimization
Read more
October 21st, 2023
Why doesn't gcc 13 display the correct binary represenation?

While answering a question here, I made the following example: #include #include int main (void) { float_t a = -248.75; printf("%f\n", a); ...

cgccc23pointer-conversion
Read more
October 18th, 2023
The headers can't be found by gcc

I have included the header file in each source file,but it fails to find them when I usemakecommand. These header files included are simple and locate...

cgccmakefile
Read more
November 5th, 2023
zero-init in gcc vs default-init in clang?

I came across unexpected diffs between gcc and clang while value-initializing objects, and suspect a bug (or two). Setup 1: struct A { A() {} ...

gccc++language-lawyerclang
Read more
December 4th, 2023
no "stdint.h" in arm-none-eabi-gcc(mac)

I'm working on a stm32f3 dev board, and met an error /opt/homebrew/Cellar/arm-none-eabi-gcc/13.2.0/lib/gcc/arm-none-eabi/13.2.0/include/stdint.h:9:16:...

macosgccarmstm32
Read more
September 29th, 2023
How can I replace gcc with g++-11 for C++20 when running cmake

Specs: WSL, ubuntu 22.04 cmake version 3.25.2 g++ version: 11.4.0 gcc version: 11.4.0 I was doing lab0 of CS144, Spring 2023 of Stanford when I got ...

gccwindows-subsystem-for-linuxg++cmakenetworking
Read more
September 23rd, 2023
"Error: invalid use of register" appears when using "-masm=intel" in gcc, but no error in AT&T mode

I tried to compile a very simple program using the gcc with -masm=intel option. But instead "Error: invalid use of register" appears. // test.c #incl...

cgccgnu-assemblerx86intel-syntax
Read more
September 22nd, 2023
Is GCC right about this being a VLA?

This question is quite similar to "Are conformant array parameters VLAs?", with the only difference being that here I'm using the static keyword withi...

clanguage-lawyerc99
Read more
September 19th, 2023
Why gcc accepts initializing the static variable within the method to the field of the object?

class MyClass { public: int obj_field; MyClass(int val) : obj_field(val) {} void myMethod() { static int my_static_var = obj_fie...

gccc++object
Read more
September 5th, 2023
Is gcc optimizing out my wait code, despite marking it volatile?

On a STM32 ARM Cortex M4, I have a simple bare metal blinky which strobes a LED on. It works fine when I use a spin wait: typedef volatile uint32_t v...

cgccembeddedinline-assemblyvolatile
Read more
September 2nd, 2023
Passing by pointer a struct instance initialized within one function on to another function in C yields different results using GCC

(I'm doing this for a personal project - just to learn how things like pointers/references/memory management work with C language. I want to do this "...

cgccreferencepointersstruct
Read more
September 23rd, 2023
How to compile with gcc on Mac OS using mariadb-connector-c

I have successfully installed mariadb and mariadb-connector-c on Mac OS Monterey using Homebrew but cannot figure out how to compile a simple c source...

macosmariadbgccmariadb-connector-c
Read more
December 2nd, 2023
How to Update GCC to include C++20

This is likely a straightforward fix, but I need to upgrade my g++ compiler to include C++ 20 libraries such as and on Visual Studio Code but I am c...

gccvisual-studio-codemingw
Read more

Hot Topic

  • 25881

    How do I undo the most recent local commits in Git?

  • 11618

    How can I remove a specific item from an array in JavaScript?

  • 20343

    How do I delete a Git branch locally and remotely?

  • 7387

    How can I find all files containing a specific text (string) on Linux?

  • 7330

    How to find all files containing specific text (string) on Linux?

  • 7611

    How do I revert a Git repository to a previous commit?

  • 2671

    How do I create an HTML button that acts like a link?

  • 8481

    How do I check out a remote Git branch?