Skip to content
Advertisement

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 code (it’s rather involved and proprietary)

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: Now I have an application that makes use

Not able to open a message queue in read mode (mq_open())

I have a program which creates a message queue and send a message (with mq_send()) to this queue. then I try to open the same message queue to read the message from another process. But mq_open() returns -1. open_and_write_MQ.c This creates the MQ. Below program tries to read the same MQ. open_and_read_MQ.c Compilation steps: execution steps: then run below program

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

How to set GCC_COLORS in gcc4.9 to emit colorizing diagnostics messages?

gcc4.9 supports the colorizing diagnostics for compiler warning/error messages. We can enable it for a particular program using the option “fdiagnostics-color”. Currently I am using gcc4.9.1 and I append this particular option in my makefile as follows: If I compile a *.cpp file a get the following nice coloured message. This is really great feature added by GCC. While reading

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 stack corruption

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 feature (I expected

Advertisement