Results for gcc
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...
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){ ...
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...
#include class Base {}; class Derived : public Base {}; // primary template template typename T> requires std::derived_from struct C { sta...
I am trying to mock a C stack overflow using strcpy like this: #include int main() { char str[10]; strcpy(str, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
Why does the code below compile with MSVC2022, but not with GCC 12? #include template auto value> class getter; template class T, class ReturnType,...
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...
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...
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 #...
Consider the following example (Godbolt): #include #include #include #include struct A { A() {} A( const A& ) { std::cout "Copy\n"; } ...
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 #...
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...
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...
While answering a question here, I made the following example: #include #include int main (void) { float_t a = -248.75; printf("%f\n", a); ...
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...
I came across unexpected diffs between gcc and clang while value-initializing objects, and suspect a bug (or two). Setup 1: struct A { A() {} ...
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:...
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 ...
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...
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...
class MyClass { public: int obj_field; MyClass(int val) : obj_field(val) {} void myMethod() { static int my_static_var = obj_fie...
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...
(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 "...
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...
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...
How do I undo the most recent local commits in Git?
How can I remove a specific item from an array in JavaScript?
How do I delete a Git branch locally and remotely?
How can I find all files containing a specific text (string) on Linux?
How to find all files containing specific text (string) on Linux?
How do I revert a Git repository to a previous commit?
How do I create an HTML button that acts like a link?
How do I check out a remote Git branch?