137 questions
0
votes
0
answers
18
views
why give error make: execvp: ar: Bad file number
when I archive object file by "ar" then it display
make: execvp: ar: Bad file number
but when object list size small then it successfully archive
what is the problem and how is it remove
I ...
0
votes
1
answer
92
views
Compiler Truncates Interrupts Vectors of ATmega328PB in Eclipse AVR Plugin
I would normally use Eclipse avr-gcc plugin and (avr-gcc compiler from zaks https://blog.zakkemble.net/avr-gcc-builds) to develop firmware for AVR MCU.
The MCU ATmega328PB has extra timers (3,4), SPI1,...
1
vote
1
answer
81
views
GCC changing signdess whole expression
I have the following code:
unsigned int m_font_timer = 0;
int Getsum(int p_top_left_x)
{
int l_sum = (((p_top_left_x + (m_font_timer >> 2)) & 0x7) - 4 ) >> 2;
if (l_sum &...
0
votes
0
answers
313
views
My updated gfortran compiler is requiring libraries that are older than those that my previous version of gfortran required - how do I fix this?
I updated the version of gfortran from GNU Fortran (GCC) 4.8.5 to version 6.3.0 in order to fix an issue with an ieee_arithmetic problem. When I did, I found that there was a whole set of new ...
5
votes
1
answer
19k
views
how to install older version of gcc -3 or gcc-4 in ubuntu 20
I'm trying to install an older version of gcc-4 on my Ubuntu system
Make a build directory (mkdir gcc-build && cd gcc-build)
Download the source file: wget http://www.netgull.com/gcc/releases/...
0
votes
2
answers
73
views
This code snippet is working the first while loop but is not executing the one after it
This code is supposed to skip a line of file and write everything else in a different file, delete the original one, and rename the different one to the one deleted. Whats wrong with this code is its ...
0
votes
1
answer
65
views
Unable to access variable name corresponding to register RTX in gcc
Is it possible to access the variable name if we have an RTX which is a reg that corresponds to a variable declared by the user in GCC?
I have found the macro REG_USERVAR_P (RTX) in rtl.h which ...
2
votes
1
answer
1k
views
how to hide local symbol for linux static library
I'm going to ship a to static library to a customer.
To maximize the privacy of the library I have restricted symbols for the static library using the technique provided by @ypsu Symbol hiding in ...
0
votes
2
answers
2k
views
/x86_64-linux-gnu/Scrt1.o: In function `_start': (.text+0x20): undefined reference to `main'
..when I run:
gcc -o server -lpthread server.c
the error happened.
and:
gcc -o client -lpthread client.c
the same error again.
I am writing a TCP-based chatroom program。
There is server.c:
#...
-1
votes
2
answers
120
views
How to control or optimize or remove or deallocate unused memory in UNION's
This question about how to control or optimize or remove or deallocate unused memory in unions? We know that the union size is maximum data type descaled inside union. Suppose I declared long type ...
2
votes
3
answers
14k
views
gcc: fatal error: limits.h: No such file or directory on macos
I am trying to pip install python-Levenshtein (https://pypi.org/project/python-Levenshtein/) on macos 10.14.5, Python 3.7, and gcc 4.7. This fails with:
/opt/local/lib/gcc47/gcc/x86_64-apple-darwin16/...
1
vote
1
answer
296
views
C printf specifier with variadic arguments. At which point is the undefined behavior problematic?
https://godbolt.org/z/qZVO3a
This is a minimal reproduction of the warnings I see. Obviously UB can be bad, but I think while many of the below situations are okay, there's some really nasty uses and ...
-3
votes
1
answer
2k
views
Compiler flag in GCC (C)
I have read the GCC documentation and man.
If I compile the code as
(1) gcc -o test test.c
I get some results when executing it.
If I compile it as
(2) gcc -O -o test test.c
I get different ...
2
votes
0
answers
137
views
Do GCC built in atomic functions provide processor level memory barrier fences?
I have to use GCC version 4.7.3 which I understand is not fully C++11 compliant (see https://gcc.gnu.org/gcc-4.7/cxx0x_status.html ) and I want to use the GCC built-ins __atomic_load_n etc., on an x86 ...
0
votes
1
answer
37
views
Compiler error trying to call base-case overloads from variadic function template
I'm trying to write a variadic template function that calls single-argument overloads as base cases. The base cases cannot be declared before my variadic because they involve types defined elsewhere. ...