What more could you want?
Posts tagged programming
Teensy ELF executables
Mar 17th
Holy crap. I wish I was at awesome as systems programming as this guy.
/cs
warning: incompatible implicit declaration of built-in function ‘strlen’
Mar 2nd
This is an error presented by the GNU Compiler Collection (which I still like to call the GNU C Compiler) when compiling a piece of code that calls to a function in the <string.h> header file if it cannot find the function.
Typically, this is caused by a call to the strlen function when the <string.h> header has not been included.
$ grep ‘#include’ whiteout.c
#include <stdio.h>
$ gcc -o ../whiteout whiteout.c
whiteout.c: In function ‘trim’:
whiteout.c:49: warning: incompatible implicit declaration of built-in function ‘strlen’
whiteout.c: In function ‘add’:
whiteout.c:64: warning: incompatible implicit declaration of built-in function ‘strlen’$ grep ‘#include’ whiteout.c
#include <stdio.h>
#include <string.h>
$ gcc -o ../whiteout whiteout.c
$
As you can see, simply placing the statement ‘#include <string.h>’ into your includes section of your code will alleviate the issue.
/cs
Adding Arguments to your Scripts
Feb 5th
I like bash.
It is simple and straight forward. In the words of Master Foo, “Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”
One of the easiest things to do in a bash script that has more than one function is to add the capability of the script to allow arguments to specify it’s action.