https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html : Some users try to use -Wpedantic to check programs for strict ISO C conformance. They soon find that
Let say I have a simple c-library project, the layout is as follows - src/ - square_root.c - log.c - power.c - newton_method.c - include
Why cannot I use local variables from main to be used in basic asm inline? It is only allowed in extended asm, but why so? (I know local variables are on the st
I want to use the std::chrono::duration literals, such as 10s to mean "10 seconds", like this: std::chrono::duration<uint64_t, std::milli> millisecs = 10s
I am using WSL Ubuntu. And use GCC to compile my C++ code. I am trying to use OpenACC to parallelize my code. I heard that I can use OpenACC with GCC. So after
I am working with the windows.h functions and everything works fine so far. But when I try to use functions which require me to link external libraries somethin
I'm using VisualStudio 2022 community to develop linux program. The cross-platform compile do works and compile outputs shows Output view well. But when double
Sample code (t667c.c, taken from here): #include <stdio.h> #include <time.h> int main(void) { struct timespec ts; timespec_get(&ts, TIM
If it doesn't, do you know what compiler or version will? See cppreference/format.
I am trying to port a C (not C++) program from GCC to Visual Studio. The GCC specific function strdupa() is widely used in this program. Is there any way to imp
I am getting gcc error when trying to install Ta-lib as a global package on my mac. I get an error below: gcc -Wno-unused-result -Wsign-compare -Wunreach
Consider the following code snippet #include <vector> #include <cstdlib> void __attribute__ ((noinline)) calculate1(double& a, int x) { a += x
I compiled a static library. I have two files. mylib_1.c with function foo1 in it mylib_2.c with function foo2 in it. Both #include "mylib.h". I compiled a libr
I try cross compile zlib for arm-poky-linux-gnueabi but I've an error when I launch make : ...:~/zlib-1.2.11$ AR=$HOST-ar CC=$HOST-gcc RANLIB=$HOST-ranlib ./co
I try cross compile zlib for arm-poky-linux-gnueabi but I've an error when I launch make : ...:~/zlib-1.2.11$ AR=$HOST-ar CC=$HOST-gcc RANLIB=$HOST-ranlib ./co
void f1(int* count, char* str) { for (int i = 0; i < *count; ++i) str[i] = 0; } void f2(int* count, char8_t* str) { for (int i = 0; i < *count; ++i)
To test for a feature, cppreference mentions these feature test macros: link. If the feature is present in the compiler, the macro is defined. But I don't unde
I am trying to use a grsecurity gcc plugin that I found on their unofficial linux kernel source tree (the respectre_plugin/ one). My GCC version is 4.7, I modif
When trying to compile OpenACC code with GCC-9.3.0 (g++) configured with --enable-languages=c,c++,lto --disable-multilib the following code does not use multipl
In C or C++, if the compiler encounters a for loop in which a counter is counting from 0 to n, and n is a variable (not a function call, and NOT A CONSTANT eith