How can we map the enum values to strings in the C programing language? Often times you need to display a C enum as a string, most often when debugging or handling error conditions. Typical techiques involve usually: a) defining an array of strings (the strings being the enum names of course, and the string […]
compile
Checking ‘dynamic’ conditions in Makefile’s
How can you test ‘dynamic’ conditions in a gnu Makefile? The net is full of GNU-Makefile advise explaining how to define variables and then later use them at compile time to run different commands or different targets. This is all very useful but often time you want to run a command and test it’s result […]
How to find out my libc (glibc) version?
To check your libc (glibc) version type “ls -l /lib/libc.” and hit TAB. This should expand the line into the name of your libc library file, e.g. something like /lib/libc.so.6 Umm… no, the .6 does not mean that your glibc version is 6, unfortunately it is a little more complicated than that 🙂 … but not […]
How can I make gcc do this…
This post will be dedicated to gcc’s command line options and various other questions related to compiling/building your code with gcc. For example… ——————– How can I get gcc to generate assembly code for my C file: gcc -O2 -S -c foo.c ——————– How can I tell gcc to generate an assembly listing? (that is […]