Is there a GCC/glibc equivalent of MSVC's _align_malloc()?
Is there any standardized function in GCC or glibc to allocate memory block at aligned pointer?Like _align_malloc() in MSVC?
View ArticleWhy does GCC chose dword movl to copy a long shift count to CL?
In the third chapter of Computer System: A Programmer's Prespective, an example program is given when talking about shift operations:long shift_left4_rightn(long x, long n){ x <<= 4; x >>=...
View ArticleTemplate parameter pack expansion failure
Let us consider the following example source in C++:template <class begin, class... end>struct test { template <end... beg_vals, begin end_val> static consteval void make() { }};int main()...
View ArticleWhy does the GCC compiler generate operands and mnemonics that specify just...
I'm just reading the book Computer Systems: A Programmer's Perspective, and in an example from Section 3.5.3, it shows us the different operations along with their assembly counterpart.Example:C...
View ArticleWhy does the GCC compiler specify its operands and mnemonics using the...
I'm just reading the book Computer Systems: A Programmer's Perspective, and in an example from Section 3.5.3, it shows us the different operations along with their assembly counterpart.Example:C...
View ArticleNVCC 9 + GCC 6.5.0/8.5.0 having trouble with __int128 and __s128 - can I...
I'm trying to build some code using CUDA 9, with g++ 6.5.0 (and also, CUDA 10.2 with g++ 8.5.0) as the host compiler, but - on a current GNU/Linux distribution - Devuan Freia, glibc 2.43, kernel...
View Articlecollect2.exe: error: ld returned 1 exit status
Please I need help when I try to compile my .C to pnggcc --std=c99 -Wall -lz a.c -o a.pngc:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lzcollect2.exe: error: ld...
View ArticleHow to correctly handle relocations in a .text section that will be moved in...
I'm looking into the Handheld Reverse Engineering Tool, which is a tool that runs on old Windows CE devices to essentially evict Windows CE from RAM and run embedded Linux instead. As the device I'm...
View ArticleUse nested functions with the cleanup attribute in C. (GCC compiler)
I am currently trying to break C a little in my free time. A thing I'd like to using the cleanup attribute to free a matrix based on the length of the first...
View ArticleBitbake tries to fetch sources from unavailable URL and they fail
I'm currently trying to set up an environment for Yocto project for my personal study.I was clueless about where to start Yocto so I bought the book Embedded Linux Projects Using Yocto Project Cookbook...
View ArticleIncluding a #define in all .c source files at compile time
I need to include a #define at the top of around 300 .c files. I would prefer not to change the code as it is open source code but if I have to I will just write a script to modify all the files. Is...
View ArticleIs it guaranteed that memset will zero out the padding bits in a structure?
In general ,as per C standard is it guaranteed that memset() with 0 will zero out the padding bits in a C structure? What about gcc?For example , something like:struct MyStruct{ unsigned char member1;...
View Articlehandling GUI with assembly language in Linux [closed]
i am very new to assembly programming language. i have a little experience with MASM which works on windows. i want to know how to deal with GUI in Linux.(i have done simple programs in assembly on...
View ArticleC++ gcc 15.2 compilation fail with template nested vector in module
gcc 15.2 fails to compile C++23 program with module where template class that uses std::vector.push_back() is defined .Adding #include <memory_resource> in main.cpp fixes the issue .Probably I am...
View ArticleProper way of compiling OpenCL applications and using available compiler options
I am a newbie in OpenCL stuffs.Whats is the best way to compile an OpenCL project ?Using a supported compiler (GCC or Clang):When we use a compilerlike gcc or clang, how do we control these options?...
View ArticleUndefined references to c23 variants
When compiling with GCC using a makefile, I'm encountering errors of the following type:/dir/to/source.c:72:(.text+0x5b7): undefined reference to `__isoc23_fscanf'This is a reference to a new C23...
View Articlecommand 'gcc' failed with exit status 1
I tried all answers but I can't solve the problem of installing Biopython packageI installed Mingw , but when I try to install the package : python setup.py installI get the following error: running...
View ArticleCMake compile project with different GCC/G++
I have a project that compiles on Ubuntu with gcc and g++ 7.5. For some reason it does not compile with the latest G++ on my Arch.For some reason, std::atomic_bool is not found, even though the exact...
View ArticleWhy does -Bgroup fail to isolate duplicate symbols in nested shared libraries...
I am trying to understand the behavior of the GNU ld linker option -Bgroup on Linux (Distro : Debian 13).To test it, I created two low-level libraries containing a function with the exact same name...
View ArticleHow to install GCC for Go on Windows 10?
I want to use external library on Go programming language and i am using this command for instance :go get github.com/alecthomas/gozmqfrom command line, but it gives such an...
View Article