gcc Questions
5
Solved
Is there any way to tell GCC to not initialize a particular global array to zero?
I want to reserve a large chunk of memory for storing a large data structure that my code manages, so I say:
#def...
2
Solved
I'm working on code that runs on a raspberry pi 3. And got the following error on my logging classes.
==1297== Invalid read of size 8
==1297== at 0x4865D1C: ??? (in /usr/lib/arm-linux-gnueabihf/li...
2
Solved
For code:
#if defined(FOO) && FOO(foo)
#error "FOO is defined."
#else
#error "FOO is not defined."
#endif
MSVC 19.38 prints:
<source>(1): warning C4067: unexpec...
Margertmargery asked 30/6, 2024 at 13:41
4
Solved
It took me a while to figure out why some cout output seem to disappear into the ether. The culprit:
std::cout<< "This line shows up just fine" << std::endl;
const char* some_string = ...
7
I'm trying to build precimonious on Ubuntu 16.04.3 x64. I allocated 1GB memory for it. My file structure looks like
~
|--- llvm/
|--- precimonious/
where the llvm is on version 3.0 as mentioned ...
3
Solved
I am including a file from a third-party library that raises an error that can be downgraded to a warning with -fpermissive. But because I do not want to "pollute" my compilation log with...
9
Solved
gcc (or other compilers) often generate huge text output and it's very difficult to see where the error is or miss warnings. I've done some search but havn't found a clean simple solution to color ...
Bildungsroman asked 17/2, 2013 at 15:56
1
Solved
I'm writing a constexpr code and I would like to inspect computed values at compile time.
The usual trick is to do something like this:
struct ReturnValue
{
int value1;
int value2;
};
constexpr...
1
Solved
Consider the following C++ code example:
#include<iostream>
class B {
public:
int val;
B(int v):val(v){
std::cout<< val << "\n";
}
};
template<typename T>
c...
2
Solved
The following code (godbolt):
#include <iostream>
#include <vector>
#include <ranges>
struct S
{
float x = 150.f;
S f() const
{
return *this;
}
};
int main()
{
std::vect...
Behlau asked 16/6, 2024 at 22:0
2
I'm trying to cross compile programs (currently avconv from libav) for a Nokia N9 phone using arm-linux-gnueabi-gcc from Linux Mint's 64-bit repository. The compiler's libc version is 2.15 and the ...
Skyros asked 11/7, 2013 at 20:47
4
Solved
The project I'm compiling uses CMake, which loves absolute pathnames.
When I compile with debugging information enabled, gcc puts those long names into .debug_str sections, which is bad for debugg...
Ernaldus asked 7/3, 2012 at 18:35
4
Solved
2
Solved
The following code,
int foo(int);
int bar(int);
int foobar(int i) {
int a = foo(i);
int b = bar(i);
return a == b ? a : b;
};
with GCC trunk is compiling to this assembly:
foobar(int):
push r...
5
Solved
Recently, I upgraded to Xcode 15, and with that the update of the xcodebuild tools. However, suddenly, my standalone C++ applications are not able to use the g++-13 compiler for some reason? Anyone...
Cima asked 23/9, 2023 at 17:12
2
Solved
(Only needs to work for gcc 5.4, if a general solution can't be found)
I have a generic factory that I use to construct objects based on some key (like a string representing a class name). The fac...
0
The following code compiles fine and generates a compile-time array consisting of not too many elements, even though the original make_sequence function generated a large sequence. In this case, th...
3
Is there some way to detect the bad usage of bool values in code like
#include <stdbool.h>
void *foo(void)
{
return false;
}
int bar(void)
{
return true;
}
Both functions are accepted ...
Harbert asked 16/3, 2019 at 15:24
5
Solved
when I use cmake in Release mode I have the following binary:
64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, Bu...
Kandis asked 30/7, 2016 at 15:9
3
I am facing an error whenever I try to compile fortran code:
% gfortran Testing_Fortran.f90 -o Testing_Fortran
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLi...
Cartulary asked 4/11, 2022 at 13:47
1
Solved
Looking at some x86_64 GCC inline assembly, I have come across the following construct:
int x;
__asm__( "<opcode> %0" : "=m" (*&x) );
^^^
This seems to be some quirk...
Zampino asked 30/5, 2024 at 12:31
7
Solved
Here is what I want to do:
Run a program and initialize some data structures.
Then compile additional code that can access/modify the existing data structures.
Repeat step 2 as needed.
I want t...
Fletafletch asked 12/5, 2012 at 14:39
3
I have a function in my C code that is being called implicitly, and getting dumped by the linker. how can I prevent this phenomena?
I'm compiling using gcc and the linker flag -gc-sections, and I...
Normand asked 31/12, 2018 at 8:38
4
I need someone to outline how to pass command line arguments to CLion. What I've found so far hasn't worked for me. Specifically I need to know how to pass multiple arguments to the program from th...
Neurath asked 10/2, 2016 at 14:34
11
I'm attempting to install texinfo 5.2, and I'm running into some issues during ./configure, which I believe are related to the C compiler. When I upgraded from Snow Leopard, I didn't perform a clea...
Shererd asked 3/4, 2014 at 17:13
© 2022 - 2025 — McMap. All rights reserved.