Quantcast
Browsing all 22097 articles
Browse latest View live

Excluding .text & .text* of a particular file from a pre-complied library in...

I am building a application for cortex-m4 MCU, and this MCU has XIP internal flash feature (executable in place). And in my application I have to read and write some configuration in the same internal...

View Article


Is __attribute__((packed)) GCC only, or cross platform?

Is __attribute__((packed)) GCC only, or cross platform?If it's GCC only, how can I check if I am compiling on GCC?So I can do this for a cross-platform packed structure:#if /*COMPILING_ON_GCC*/# define...

View Article


`++a + a+++ --a` compiling with gcc and clang gives difrent answer and both...

#include// #include <stdio.h>using namespace std;int main(){ int a = 3; int b = ++a + a+++ --a;  // printf("%d\n", b); cout << b << endl;  return 0;}This is a block of code I tried to...

View Article

main.c:16:9: error: stray '\32' in program in C [closed]

I am trying an example from the GNU C Programming Tutorial (page 93) that uses a few of the math library routines listed.#include <stdio.h>#include <math.h>int main() { double my_pi; my_pi...

View Article

C programs getting detected as Malware

Recently my C programs started to act weirdly and I had no idea why... Then I realized that they were being flagged by my antivirus program as malware... First I thought there's a malware in my...

View Article


Compile time error while running multiple c files

#EditedI am tested on simple two files now that are add.h and add.c.I made a Makefile in order to compile my program. Here is my makefile.# Make file for running the projectCC=gccCFLAGS= -Wall...

View Article

Numeric file identifier like __FILE__ for logging purposes

I have a couple of rather large gcc-based C-projects (more than 400 files, partially shared by the projects) where each file has something like a file id for logging output. This boils down to...

View Article

Can I use GCC compiler AND Clangd Language Server?

I am working on a project that uses a GCC library (SFML), which is not available for clang, as far as I know. I am using COC with vim for code completions, but for C++ it needs clangd. Is there a way...

View Article


😃 (and other unicode characters) in identifiers not allowed by g++

I am 😞 to find that I cannot use 😃 as a valid identifier with g++ 4.7, even with the -fextended-identifiers option enabled:int main(int argc, const char* argv[]){ const char* 😃 = "I'm very happy";...

View Article


GCC stackoverflow on large array declaration

Below Code works fine#include "bits/stdc++.h"#define ll long long#define endLine "\n"using namespace std;bool dryRun = true;int main() { ll n, testCount; ll arr[100000]; ll pre[100000]; // ll...

View Article

How can I determine what header calls another header in c++?

I am reading from here : Can std::string be used without #include <string>?, <iostream> is calling <string>. But I do not see any includes of <string> in Standard library header...

View Article

experimental::filesystem linker error

I try to use the new c++1z features actually on the head of development within gcc 6.0.If I try this little example:#include <iostream>#include <experimental/filesystem>namespace fs =...

View Article

Why is int e = 3000000000 not a warning in gcc?

Consider the following C program:#include <stdio.h>int main(int argc, char *argv[]) { int a = -5000000000; int b = -3000000000; int c = -1000000000; int d = 1000000000; int e = 3000000000; int f...

View Article


Why do some compilers like gcc, require you to activate optimizations? Why...

Title basically, why not run all possible optimizations by default?

View Article

C preprocessor macro expanding itself

I believe that the answer to my question is tied to C Preprocessor, Stringify the result of a macro. However, I'm having trouble applying the solution to my use case.I have this function:astNodePtr...

View Article


Why do I get a segmentation fault when running an example program compiled...

In shortWhat are cmake's web of makefiles doing differently from a simple compile and link that is making a difference in the final executable? I'm trying to use the bullet physics library...

View Article

QEMU GDB step-instruction advances over multiple instructions

I have a pretty trivial bit of bare-metal assembly code running on an arm64 QEMU instance. When debugging with GDB via the QEMU debug port, single step (stepi) is advancing over instructions rather...

View Article


Gcc error: gcc: error trying to exec 'cc1': execvp: No such file or directory

I have been successfully using gcc on Linux Mint 12. Now I am getting an error. I have recently been doing some .so builds and installed Clang not to long ago, but have successfully compiled since both...

View Article

LibCrypto Example SHA1 with g++ on MSYS can't be build [duplicate]

I trying to learn SHA1 on C++ using LibCrypto and I use MSYS2. I already come across some thread on stackoverflow such as Undefined reference to CryptoPP::AlignedAllocate(unsigned int) but still I...

View Article

Run LLVM test-suite on HPI shows script not found error , how to fix it

I have se-benchmarks I tried to run it using gem5, following this tutorial https://github.com/arm-university/arm-gem5-rsk/wiki but it shows me this error (Script intMM not found). intMM is an...

View Article
Browsing all 22097 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>