co_await inside catch no longer compiling with GCC12 [duplicate]
I have a code that looks like this:auto func() -> asio::awaitable<void> { try { co_await async_operation(); } catch(boost::system::system_error const& e) { co_return co_await...
View ArticleWhy do you need crt2.o in C++?
Programm Hello World (hello.s) .dataLC0: .ascii "Hello, World!\0" .text .globl _main_main: pushl %ebp movl %esp, %ebp andl $-16, %esp subl $16, %esp movl $LC0, (%esp) call _puts xorl %eax, %eax leave...
View Articlegcc download on windonws ubuntu bash IP address fetch returns error
I've attempted to gcc a test.c file on my windows linux bash subsystem, gives me the "gcc not installed" so i go and try to install gcc usingsudo apt install gccso i'm using the root "sudo" so...
View ArticleBuilding latest Vala releases (make check fails and valac can't find shared lib)
I have downloaded the last two latest releases of VALA (v0.17.0 and 0.16.0) and have attempted to build on my dev machine (Ubuntu 10.0.4 with gcc 4.4.3).When I built v 0.17.0, I noticed that some...
View ArticleWhy not always use fpic (Position Independent Code)? [duplicate]
I read this post on PIC and it seems that it always be good to use PIC (whenever it is exe / static / share llibrary).So what are the disadvantages?Are there examples elaborating when not to use PIC?
View ArticleHow to write math library in C on ubuntu [closed]
I am just learning C and get an error. After searching on Google, I find out math.h does not work on Ubuntu and alsothey told to add -lm in gcc compailing bg but I want run on VScode Terminal but it...
View ArticleRISC-V GCC .insn directive for I type instructions
I am attempting to test a custom extension on RISC-V QEMU, the instruction is of i-type, and I am using a PC variable as an immediate to be offsetted, my standard technique has been to useasm...
View ArticleSetting __attribute__((used)) to C variable/constant has no effect
On ARM GCC (plain C code), when I declare a constant as in__attribute__((used,section(".rodata.$AppID")))const uint8_t ApplicationID[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,...
View ArticleWhy does the size of the binary executable increase by different amounts for...
Let's say I have a C++ program and I compile it using g++. I then get an executable file which, as an example, has a size of 100 kb. I then add a couple of lines of C++ code and compile again and the...
View ArticleAT&T Assembly Syntax in C program (Mingw gcc) [duplicate]
This simple program((AT&T Assembly Syntax) ) works fine on Linux, but compiles on windows with an error。.section .text.type add,@function.global add add: pushq %rbp movq %rsp, %rbp movl %ecx,...
View Articleboost::adaptor::filter segfault with compiler optimisations
I have some weird behaviours when using boost::adaptors::filter. Let's note that I created a small example that respects my larger project contraints. With the following short example I have a segfault...
View ArticleHow does the scanf_s function work on MinGW GCC?
#include <stdio.h>int main (void) { char str[100]; scanf_s ("%[^\n]", str); printf ("%s\n", str); return 0;}This code can be successfully compiled whthout any errors or warnings by MinGW GCC...
View ArticleHow to Unlink GCC from homebrew GCC?
Every time I Open terminal It asks for password and it get annoying when I have to open terminal for running code, I have to put password first everytimeenter image description here
View ArticleQt application crash on Wayland
I've recently installed Ubuntu 22.04 LTS on my development laptop. Previously I was running 18.04 so this is my first experience of Wayland. I did a clean installation on a new disc. I had relatively...
View ArticleMultiple definition of first defined here gcc
I have these files consumer.cppconsumer.hppdefines.hppmain.cppmakefileproducer.cppproducer.hpphere's the file defines.hpp#ifndef DEFINES_HPP#define DEFINES_HPP#include <cassert>#include...
View Articleavr-gcc not compiling interrupts when they are in another file
I did a SIMPLE program with avr-gcc for ATMega328p with a SIMPLE ISR. The issue is: when I put the ISR OUTSIDE main.c file the compiler doesn't use it.The original main.c:#include...
View ArticleGCC v12.1 warning about serial compilation
I have upgraded my whole arch linux system today (12th May, 2022). gcc was also upgraded from v11.2 to v12.1. I tried compiling some of my programs with g++ (part of gcc compiler collection) by the...
View ArticleCompiling visual studio 2015 c++ project with g++ compiler [duplicate]
I am trying to compile my Visual Studio 2015 project with the g++ compiler. I know visual studio uses the MSVC compiler, but I tried compiling a minimal vs example with g++ and it worked (not sure if...
View Articlewhen make elf, link is fail. post R_AARCH64_ADR_PREL_PG_HI21 error
in my asm code, i use _bss_beginadr x0, _bss_beginadr x1, _bss_endwhich is defined in link.ldSECTIONS{ . = 0xffff000000000000; .text.boot : { *(.text.boot) } . = ALIGN(0x00001000); user_begin = .;...
View Article/usr/bin/ld: skipping incompatible...
guys. I'm newbie to this PipeCNN. When i want to run the makefile, it showed 'skipping incompatible for a binary file when searching for binary file.g++ ./host/main.o ../common/ocl_util.o...
View Article