You should also add debugging options on the command line. I would run gcc as:
-g adds debugging information for use by gdbCode:gcc -Wall -Wextra -Wpedantic -g -o inventory readline.c inventory.c
-o names the final executable, otherwise a.out is the executable name.