How to disable fast math for a header file function
How do I disable fast math for a function defined in header file or for the entire source file? #pragma GCC optimize ("no-fast-math")Adding the line above to both (source file and header file) doesn't...
View Articlegcc 10.1: weird behavior with clang-tidy (clion) and precompiled headers (cmake)
I have had problems with my IDE since an update to GCC 10.1 a few days ago. I use CLion, which uses clang-tidy as linter. I also use the newly introduced command target_precompiled_headers from CMake...
View ArticleGHC can't find foreign library (libjack.lib) that works with mingw gcc (but...
Objective:I am writing a haskell program on Windows 10 using stack and the bindings for jack from hackage. Jack is installed and its lib/include paths are provided to ghc. My objective is to build the...
View ArticleHow are local variables stored on the call stack (GCC compiler)
I apologize if this has been asked before, I did try looking at old questions but I am still confused as to how the GCC compiler stores variables on the stack. I understand that it grows downward but...
View ArticleGNU assembler Macros
I am trying to build a simple macro in GNU assembler (2.26.1) (gcc 5.4.0) but getting some error after several interactions: Invalid character '(' in mnemonicI've tried to follow the advice at...
View Articleiostream vs ostream what is different?
As the book says (Exploring C++: The Programmer's Introduction to C++):The istream header declares input operators (>>), and ostream declares output operators(<<).I can perfectly run the...
View ArticleCan this piece of code be modified such that it works with fast-math enabled?
Can the code below be modified such that it works correctly even when compiled by GCC with fast-math enabled? #include <iostream>#include <float.h>using namespace std;int main(){ char...
View ArticleShould clang and gcc produce a diagnostic message when a program does pointer...
This program compiles without errors, for example with clang -Wall -std=c11 a.c and gcc -Wall -std=c11 a.c. Is this a bug in clang and gcc? Because arithmetic is not defined on pointers to function...
View ArticleWhy qemu execute the bin of mipsel failed?
1.This is my mips assembly code .dataout_string: .ascii "hello \n" .text .global mainmain: li $v0, 4 la $a0, out_string syscall li $v0, 10 syscall2.Then I as the codemipsel-linux-gun-as --march=mips2...
View ArticleI am trying to split this code into two .c and one .h file, but the structure...
I have made a code which runs perfectly fine in a single file but when I try to split the code into two .c and one .h file the makefile shows an error of UNDEFINED REFERENCE TO THE STRUCTURE which is...
View ArticleI have a technical issue compiling with mpicc
My gcc works fine when I compile '''gcc''' but I'm trying to compile a C program with '''mpicc''' and my terminal returns this error, which deletes also the...
View ArticleHow to link to a shared library using Automake
Having spent most of my development career in IDE I'm currently attempting to extend an Opensource project C-ICAP that uses Autoconf and Automake, so this may be a glaringly obvious answer to those...
View ArticleStrange memory issue with sscanf
Using gcc-arm-none-eabi-5_42016q3-20160926 tool chain in eclipse.Processor: STM32F030I have a 3 line program that starts before any hardware initializations to isolate the problem: int a; char *...
View ArticleIs "char" a special type of integer variable?
I recently came across a statement saying that "char" type in C is really a special form of integer – one that stores the ASCII code numbers which represent characters and symbols.How far is this...
View ArticleWhy do I get no error when I pass too many arguments? [duplicate]
I have an Atollic True Studio (Eclipse) project with many files.I have noticed that the project compiles despite the fact that one of those files contains a function call with arguments where the...
View ArticleLoop fission/invariant optimization not performed, why?
I am trying to learn more about assembly and which optimizations compilers can and cannot do.I have a test piece of code for which I have some questions.See it in action here:...
View ArticleLinking shared libraries with dependencies
I have a program which is dependent upon a library (called "libFoo.so" here). libFoo.so is also dependent upon a number of other libraries: libVendor.so, libFooVendor.so, and liblog.so. Whenever I try...
View ArticleWeird linker error gcc when following simple kernel tutorial
Im following this tutorial on how to make a simple bootable kernel: http://www.osdever.net/tutorials/view/writing-a-simple-c-kernelthere are the following required files in the tutorial:kernel.csource...
View Articleinstalling pf-ring on Mac OS X
I'm trying to install pf-ring on mac os x yosemite 10.10.4. Doing what's written here: http://www.ntop.org/get-started/download/so:git clone https://github.com/ntop/PF_RING.gitcd PF_RING/kernelso far...
View ArticleCompile error, when building tensorflow v1.14.0 without avx2 support
Using Debian 10 Buster, Python v2.7.I try to build specific tensorflow v1.14.0 without avx2 support, because I get following error:Nov 4 17:12:32 moodle37 kernel: [9773297.574293] traps:...
View Article