You should also add debugging options on the command line. I would run gcc as:
Code:
gcc -Wall -Wextra -Wpedantic -g -o inventory readline.c inventory.c
-g adds debugging information for use by gdb

-o names the final executable, otherwise a.out is the executable name.