g++ generates undefined instruction(ud2) when trying to access 0x00 from kernel
I'm trying to write a small Kernel. This code is executing in 32-bit Protected mode with paging and interrupts disabled.As the title suggests when I try to access 0x00 from my Kernel, the compiler...
View ArticlesetTitle() function is making crash my program if not hardcoded String
Since now I'm programming on my Maze game for College. I am almost ready. Just need to beautify it.Here I thought 'bout making a setTitle function. Whenever testing it, it had some strange symptomps...
View Articleusing a Makefile in Xcode - or alternative IDE
I am new to Xcode, Makefiles, and to programming generally.I have been given an existing C++ code to work with that is built using a Makefile. Using the Makefile I can build and run the executable on...
View ArticleGetting rid of cast-align warning for one specific case
I'm using this implementation of container_of on arm: #define container_of(ptr, type, member) \ ({ \ const typeof(((type *) NULL)->member) *__mptr = (ptr); \ (type *) (void*)((char *) __mptr -...
View Articlewhy can’t we use any modifiers in float data type in c
why can’t we use any modifiers in float data type? #include <stdio.h> int main(void) { signed float a; short float b; return (0); } If tries to use it ,the compiler gives compile time...
View ArticleHow to build relocatable binary which includes only selected symbols from...
I am trying to build a relocatable binary file for an embedded system which includes only some libraries. It will not include any source file, just the libraries will be linked into a relocatable file...
View ArticleHow to update GCC in MinGW on Windows?
I'm used to manually install GCC from source before on Ubuntu and it was a painful process. So I really don't want to do repeat this process. Currently, I have MinGW and GCC (4.6.2) installed on my...
View Articleunsigned conversion in C works as expected on x86 but not ARM [duplicate]
I am facing a problem running a C program on ARM processor.#include <stdio.h> #include <stdlib.h> int main() { float f = -40.000000; unsigned int a = f; printf("\t Actual TX Power = %0.2f...
View ArticleGCC6.3.0: flag "--coverage" not functioning (no gdca files generated)
Having a code snippet in C and the same in C++, which generates gdca files executing the exe which is compiled with GCC 4.1.2. The same code snippet compiled with GCC6.3.0 after executing is not...
View ArticleBootstrapping Bazel for Raspberry Pi 4 failed, jni_md.h not found
I'm currently trying to compile the latest version of Bazel (2.2.0) from source on a headless Raspberry Pi 4 that has Raspbian Buster installed. I was using this page as an installation guide.I had no...
View Articlelinking error. Perhaps a problem with ordering?
I'm building a program which uses GTK+3 and pango. Most of it compiles fine apart from the last bit which builds the executable. The final command is:gcc -o z80sim main.c -Wall -Iz80 -Igui obj/disas.o...
View ArticleCan GCC only compile code for one specific architecture and operating system?
GCC is a compiler collection that generates machine code from different programming languages. For that you have to compile the compiler to run on your architecture and operating system. But you also...
View ArticleXcode and Curses.h with Error opening terminal
I am trying to compile a simple curse project with Xcode. The program compiles fine with g++ in terminal with the flag -lcurses, and runs fine.Started of by creating a Command Line Tool with type c++....
View ArticleStrange problem when trying to link C code against ICU Unicode libraries on...
I have been playing around with the ICU Unicode libraries and I recently encountered some strange linking errors that have stumped me.I've narrowed the code down to a minimal example which demonstrates...
View ArticleUbuntu DB2 gcc prep errors on functions slqastrt, sqlacall, sqlastop
I am now attempting to make a simple "create table" C - embedded sql application with gcc.My sqc file code:#include <stdio.h> #include <string.h> #include <sqlca.h> /* CREATE A...
View ArticleGCC on windows No space left on device
When using GCC to compile a simple hello world program, I get the following error:c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link failed: No space left on device There...
View ArticleWhy is C++ executable running so much faster when linked against newer...
I have a project (code here) in which I run benchmarks to compare the performance of different methods for computing dot product (Naive method, Eigen library, SIMD implementation, ect). I am testing on...
View Articleis char really bad in modern C?
I'm doing a C programming exercise, but I have some problems with declarations. I read I shouldn't use char declaration type, but I should use int instead (according to https://matt.sh/howto-c I should...
View ArticleOrdering of object files and libraries in static linking
I've created a simple static library libvec.a with AR tool from simple addv.o and multo.o. The object file addv.o contains 1 function symbol (addvec) and multo.o contains 1 function (multvec). I have...
View Articleim not able to find what is causing the segmentation error in my C++ code...
I have a C++ program where i have to rotate the array clockwise according to the given number of elements to be rotated (x) For example if the input array is [1,2,3,4,5],given that 2 elements (denoted...
View Article