Remove a section from ELF during linking stage
How can I remove a section from ELF during linking stage? Is there any linker option or flag for this? I'm mostly interested on how it can be done with LLVM, but any information about GCC will be...
View ArticleCapture output of GCC compiler in VB.Net
I've vb.net form with several textboxes and in the code I've defined a process that starts a GCC (MinGW) compiler. The compiler then compiles a C++ file as shown in the code below.Dim proc As...
View ArticleError compiling with GCC/Clang on Mavericks
Apparently Apple removed gcc with the latest OS and now gcc maps to clang.Anyhow, I installed the latest Command Line Tools (Oct 22nd version), but still get the following error messages when trying to...
View ArticleCompiler optimizes out the coroutine value
I have implemented two coroutines that uses the Resumable class:#include <coroutine>#include <future>#include <iostream>class Resumable{public: class promise_type { public: auto...
View Articlehow to fix include no such file or directory exists in windows OS
I have been battling with this problem all day. i have read a lot of articles on this issue but no one seems to be talking about windows OS.I am working on an encryption algorithm written in c that has...
View ArticleWhy doesn't this compile [closed]
#include "base.h"#include <Poco/SharedPtr.h>#include <Poco/AutoPtr.h>#include <vector>using Poco::SharedPtr;using Poco::AutoPtr;namespace kroll{ class Value; class KObject; class...
View ArticleWhy does GCC handle a const reinterpret_cast different when type alias is...
In the following code:#include <cstddef>class s;void foo(void* buffer) { using s_ptr = s *; const auto b_s = reinterpret_cast<const s_ptr>(buffer); const auto b_s2 =...
View ArticleWhat is the purpose of format specifier "%qd" in `printf()`?
I saw format specifier %qd when browsing github code. Then I checked in GCC compiler, it's working fine.#include <stdio.h>int main(){ long long num = 1; printf("%qd\n", num); return 0;}What is...
View ArticleInclude path not working for Bluez libraries
Im trying to develop application in C using Bluez library on linux. I cant figure out how to properly passall include paths to compiler so that all libraries I need will be visible.No matter what I try...
View ArticleD_FORTIFY_SOURCE=2 option does not work for me
I saw that GCC 4.5 and above versions should support –D_FORTIFY_SOURCE=2 option. But it does not work for me, it has been ignred and it does not report issues when i used.Compiler version used is...
View ArticleSpecialisation of class with template template parameter working in clang but...
I am trying to make my code, already working on clang, compatible with gcc. I have the following main class:template<typename T, typename...Ts>class OperatorTypeHelper{ public: using...
View Articlegcc turning on -O3 causes bug on 128 bit integer [duplicate]
Two versions of a function that multiplies a unsigned 256 bit integer by constant 977. (for cryptography application) Note __int128_t type is used in the 2nd function.#include <stdint.h>#include...
View ArticleUnderstanding gcc -S output
I did gcc -S on the very complex program below on x86_64:int main() { int x = 3; x = 5; return 0;}And what I got was: .file "main.c" .text.globl main .type main, @functionmain:.LFB0: .cfi_startproc...
View ArticleARM Cortex-M7 GCC Linker error Relocation truncated to fit R_ARM_PREL31 when...
Good day everyone.I have a large project for STM32H747XI and there is many of code files that could not be placed into main FLASH memory region so I'm trying to place it on external QSPI flash. So I...
View ArticleHomebrew does not link gcc 5.3 to /usr/local/bin/gcc (OS X 10.11.4 El Capitan)
I just updated my Mac Book Pro to El Capitan (10.11.4) and gcc 5.2 broke, so I installed gcc 5.3.0 using homebrew but the new compiler is not linked to /usr/local/bin/gcc. Instead it's linked to...
View ArticleAddressing two unrelated arrays with [base+index*scale] without UB
I'm trying to figure out how to get GCC or Clang to use [base+index*scale] addressing to index two unrelated arrays, like this, to save an add instruction:;; rdi is srcArr, rsi is srcArr - dstArr, rax...
View ArticleProblem compiling DOOM source: error: initializer element is not constant...
I'm trying to get the original Doom code compiling.I already fixed some errors but I don't know what this means. I'm not that good at C...Example error (there are more errors, but they're the...
View ArticleThe gnu GCC compiler has the --target=mc68K does it mean it can target all...
In the GCC manual it is stated that --target options has mc68k does this mean it supports the following processor? Will I be able to make an OS for the specified processor? I have attached the image...
View ArticleHow To Install GCC On Cygwin
So this C/Python book that I own says to choose gcc, gcc-core and gcc-g++ on the Select Packages window. But I couldn't find any such on the list, so I searched up gcc and selected all these from here,...
View Articlewhy compiler make two identical code for same template type
For a template defined as:struct sameT{};template <class T>void print(){/*do stuff*/}int main(){ print<sameT>(); print<sameT>();}When I watched the machine code generated by gcc for...
View Article