__builtin_memcpy – hinting the compiler for max value
I’m getting compilation errors with the new gcc-13
Why fwrite writes an excessive byte 00 at the first byte of file?
I wrote this piece of code :
How does division by zero works in C++?
#include <iostream> using namespace std; int main() { cout << “main started”; int a = 10, b = 0; cout << a/b; cout << “main ending”; } The above written C++ code is not printing anything on online compiler when run on “OnlineGDB” with C++ 20 vesion. But the same program when run on g++-14 […]
C Declaration with Self-Assignment Compiles
I was extremely surprised that the following C-code compiles:
How do I force gcc to call memcpy under -Os
Under -Os, gcc likes to inline memcpy into rep movsb
(x86-64).
How can I make it actually call memcpy
while keeping the -Os compiler option?
g++ works but g++-14 produces a lot of errors on macOS
I want to run g++-14 which I installed through brew install gcc
so I can use the most up to date version of C++, but after installing I get a lot of errors when trying to compile code.
Assert GCC that return value is in some range
Say I have some function
Why does this GCC code define a macro called ‘void’?
I was reading the GCC implementation of malloc
when I noticed this macro definition :