Skip to content

Tag: gcc

How to squash bug that only occurs with optimizations enabled

I’m in a bit of a pickle. I have some code that until recently ran fine but has now started to fail when optimizations are enabled. This code runs just fine with optimizations disabled -O0 both -O1 and -O2 cause the issue to occur (I don’t use -O3). Unfortunately, I can’t post the source cod…

Symbols not found during linking

I have a problem with a shared library (Linux) and a program that links against this library but does not find the symbols – although they are there. That’s what I have: A shared library “libetest.so” that is located in /usr/lib. When I do an it gives (beside some others) this output: …

Compiling a program with limited library access

i want to compile a C program with gcc and glibc(or any other c library) but i want to limit the program access to certain functions for example program should not be compiled if it uses sockets or signal handling functions. any idea how i could do this?? by the way i want to use this on a simple programming

Variable reset after scanf

I wrote the below function : I print the currentPlayer on any level to see what’s going on -> here what I get: Why the current player is 0 after scanf? I didn’t touch it. Answer The buffer location has only room for 2 characters and scanf puts an extra NUL character at end. Therefore you have a…

Does Clang/GCC really support a delay loading feature?

Would you mind to leave your comment on this if you have really experienced which relates to the title above? I have tried to make a shared object to be delay loaded with both Clang and GCC on Ubuntu (I actually don’t mind which compiler is used), but they do not look really support any delay loading fe…