On page 11 in the printed book, the “What You Should See” (Exercise 2 Session) at the bottom says I should be getting a warning for implicit declaration of function 'puts’. Overleaf on page 12 the top block is a warning that “If you fixed ex1.c to have #include <stdio.h>, then your output won’t have the warning (which should really be an error) about printf. I have the error here because I didn’t fix it.”
I didn’t get a warning for either printf or puts. I looked through the book and the repository of example code on github, and tried to check my own work, but I can’t seem to figure out where I went wrong:
1.) Page 6 has us putting in #include <stdio.h> right at the beginning; I couldn’t find any specific instructions to take it out.
2.) Is ‘puts’ a typo or did I unknowingly skip a section? I looked up both functions and muddled my way through their man pages, and I believe they both print things to the console.
3.) I tried commented out the #include to see what would happen and got a slightly different error than anticipated:
"warning: incompatible implicit declaration of built-in function ‘printf’
ex1.c:9:5: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
Is this expected behavior?
4.) On page 11, are we first creating a file called ex2.1.mak, then saving a copy of it as Makefile so that there’s two files with different names but identical contents? I’m not sure if I read that part correctly either.
In case the platform or versions matter, I’m running a 64-bit Linux VM (Arch distribution) in VirtualBox, on a Windows 7 laptop. Using --version flags, the shell says I’m using GCC 8.1.0, GNU Make 4.2.1, and GNU bash 4.4.19(1).
I apologize in advance for how dense these questions must seem, but I’m trying to take the core competency of Attention to Detail to heart and not blindly rush ahead without checking my work.