Getting an error "the input file is same as the output file
I am very new to C programming and I just installed mingw and started using vs code. I have installed all teh extension required in the VS code and have selected the default builder as gcc in the vs...
View ArticleMy project build is failing to compile with gcc - WinMain issue? [duplicate]
Makefile is not working as expected. Compiling in windows with MSYS2 MinGW 64-bit - LDFLAGS is causing issue and I've tried two options.....LDFLAGS = -lSDL2 -lncursesw -mconsoleand currently...LDFLAGS...
View ArticleHow is the function get called with -O2?
I had below C program:__int64_t fib_tr_const (__int64_t n, __int64_t n_1, __int64_t n_2){ if (n == 0x42 || n == 0x43 ) { return n_1 + n_2; } return 0x31 + fib_tr_const (n-1, n_2, n_1 + n_2);}void main...
View ArticleHow to make my gcc-12 use latest MacOs SDK
So the latest MacOs Sdk is MacOSX15.0.sdk.when I rungcc-14 -vit showsUsing built-in...
View ArticleHow to generate godbolt like clean assembly locally?
I want to generate clean assembly like Compiler Explorer locally. Note that, I read How to remove “noise” from GCC/clang assembly output? before attempting this. The output using that method isn't as...
View ArticleAddressSanitizer interceptor_via_fun
Would like to suppress the following error detected by AddressSanitizer.==114064==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffe60fee2f0 at pc 0x000001e6ef34 bp 0x7ffe60feb6c0 sp...
View Articlegraphtool ImportError: .so: invalid ELF header
I am trying to write my extensions with graph-tool following this guide about Writing extensions in C++ to extend graph-tool with code written in C++.Following the guide at the link i downloaded the...
View Articlegcc size of types
As the size of the types is not close in the standars of C, if not that there are a maximum and minimum size for them, I would like to know where I can find how gcc interpret this.Where is in gcc...
View ArticleBuilding R Packages using Alternate GCC
The systems I work with have GCC 4.5 (experimental) in /usr/local/bin/gcc which has proven to be problematic for some R packages. I would like to instead use system GCC in /usr/bin/gcc.I have tried...
View ArticleBinding to initializer_list accepted by g++, but rejected by clang
The following code is accepted by g++ (14.2.1):#include <vector>template<typename T>void foo(T i, std::vector<int> &v = {}){ }int main(){ std::vector<int> v; foo(3, v);}but...
View ArticleWhat to do if isn't recognize (in C11)?
I've been learning how to do multi-threading in C and wanted to use <threads.h>. But it (my compiler GCC 8.1) says that <threads.h> isn't a file or a directory when I wanted to compile this...
View ArticleHow to tell GCC to generate 16-bit code for real mode
I am writing real mode function, which should be normal function with stack frames and so, but it should use %sp instead of %esp. Is there some way to do it?
View ArticleSIGFPE when accessing unordered_map
I have an unordered_map<Block, int> with Block being a simple struct defined as follows:struct Block { size_t start; size_t end; bool operator==(const Block& b) const { return start ==...
View ArticleHow to silence "whose type uses the anonymous namespace [-Werror]" gcc...
In one of my project's header file, the following line is included in a inline methodtypedef boost::archive::iterators::transform_width<boost::archive::iterators::binary_from_base64<...
View Articlecannot install gcc on almaLinux release 9.3
I am not able to install gcc on my network switch (64-bit machine) for an application that needs to be compiled on the switch (running the following redhat version.)[admin@sw ~]$ cat...
View ArticleHow would i exactly make a graphical user interface for my kernel
I have been start learning how to make an OS recently , and i already figured out how to use gcc , nasm and grub tools , but now i am confused on how should i display some gui on the screen instead of...
View ArticleGCC/Clang-18 compiler assumes type as unsigned int for enum
Hello and thanks for reading,I just came upon a bug in my C program and while I was able to find out the cause of the bug I am having trouble rationalizing the behaviour of the compiler and I could use...
View Article`gcc -undef` leads to `cannot find entry symbol _start`; defaulting to x
When running gcc -undef file.c, on a file containing nothing but a main function, I get this warning from ld:/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000401020There...
View ArticleProgram with SUID flag not working properly
I have a simple program to check if a specified user (1001) has read access to a specified file. The owner of the program is 'root' and additionally the program has the 's' (suid) flag set. After...
View ArticleRISCV vector extension
Not able to execute a C program which has vector addition using RISCV.I downloaded the gnu tool-chain and added the vector extension. But when I am running a sample C code which does vector addition,...
View Article