Ubuntu gcc shows stdio.h no such file or directory
When I test gcc in my Ubuntu, I try to write a simple c program to test, but it shows "no such file or directory like <stdio.h>".See screen capture here.
View Articlewhat does the weak_alias function do and where is it defined
So I'm looking through the source of gcc compiler and I've come along this in fork.c:int __fork () { __set_errno (ENOSYS); return -1; } libc_hidden_def (__fork) stub_warning (fork) weak_alias (__fork,...
View ArticleData race when passing pointer to std::thread
I am puzzled by a thread-sanitizer report which occurs for both GCC 8 and Clang 9 (I haven't tried others). There is a struct Bar with the following code:struct Bar { Bar(bool create_foo) { ... if...
View ArticleInstall gccgo for testing Protocol Buffers 3 along with Go
I'm trying to install gccgo for testing Protocol Buffers 3 with Golang...I have to confess that I'm back to dev after 8 years off (and I'm not a native speaker) so, thank you for your indulgence. Thank...
View Articlecodeblocks can't find my compiler
OK, so I downloaded Codeblocks and I already have a cygwin terminal on my computer that I regularly use to compile and run C programs, but when I try to build a program in CodeBlocks, it gives me an...
View Articlegcc: What is the section in the beginning of a function with MIPS in assembly...
I write a simple code for test.#include <stdio.h> int funadd(int a, int b){ int x = 0; x = a + b; return x; } int fun(int a, int b){ int y = 17; int returnvalue = 0; returnvalue = funadd(a, b);...
View ArticleWhy does gcc use movl instead of push to pass function args?
pay attention to this code : #include <stdio.h>void a(int a, int b, int c){ char buffer1[5]; char buffer2[10];}int main(){ a(1,2,3); }after that : gcc -S a.cthat command shows our source code in...
View ArticleReverse bits using lookup table in O(1) time [duplicate]
I am a C language programmer (version C89) and am looking for an effective way to build mirror bit and count_on (counting bits whose value is 1) using lookup table, the problem I do not want to put in...
View ArticleGCC for MIPS emits assembly label(?) with "= ."
Heyho everyone,I'm using the GCC 9.3.0 to generate Assembly files for MIPS. When looking at those assembly lines I noticed something that looks like a jump label - but it is never referenced....
View Articledocumentation of gnu assembler directives
I'm trying to learn mips assembly at the moment. To that end, I wrote a very simple c program...int main(){}...and compiled it on a mips machine with the -S option to gcc to generate assembly code....
View ArticleSpliting the code in ARM GCC linker script
I have a project that requires a function to be placed at a particular location in flash (0x1555 to be precise). The issue is that my code is larger than this. When I build now, I get the following...
View ArticleHow do we install gcc-go to AIX machine power-pc-7 bigendian 64 bit?
I have a AIX machine which runs on power-pc-7 bigendian 64 bit I understand installing Go compiler is easy for Windows,Linux and Mac but if we want to install it on AIX then it involves different...
View ArticleHow can I see the full file path in compiler errors?
I have a CMake project that I compile with gcc on Linux. Because of how CMake invokes gcc in subdirectories, gcc outputs only the base file name when it encounters an error:[100%] Building C object...
View Article/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found
How can I get GLIBCXX_3.4.15 in Ubuntu? I can't run some programs that I'm compiling.When I do:strings /usr/lib/libstdc++.so.6 | grep GLIBCI...
View ArticleStack overflow when adding link dependency. Available stack reduced with...
ProblemI get a stack overflow if I link against a library, and I don't get it if I don't. Here is the code:#include <pthread.h>#include <stdio.h>#include <unistd.h>#include...
View ArticleIs there a way to define a function with an implementation with a different...
I have a function in a header that needs to be implemented for the rest of the code to work. Normally I would implement this function in main.c after including the header and the linker would clean up...
View ArticleHow does GCC implement __attribute__((constructor)) on MinGW?
I know that on ELF platforms, __attribute__((constructor)) uses the .ctors ELF section. Now I realized that the function attribute works with GCC on MinGW as well and I'm wondering how it is implemented.
View Articleexecute shellcode not on the stack (buffer overflow)
Is it possible to execute your shellcode not on the stack? Is there another way to execute the shellcode? Thanks in advance
View Article`return_if(cond, val)` without resorting to macros
I'd like to create a return_if(cond, val) without resorting to macros, for using in non-static member functions. It should be equivalent to{ //do some stuff on non-static data members here if (cond)...
View ArticleWhat is the standard way to manage calling-convention compatibility between a...
I'm building a C program which explicitly dynamically loads DLLs as part of a plugin system. I'm using GCC with Mingw on Windows 7.What calling convention should the exported functions in the DLLs use,...
View Article