Notes for 09/16 CISC105 Fall 2005 (1) We talked about the Makefile for lab02 and mentioned that you can edit it to change between using gcc and cc, if your account is still having problems with gcc. If you are still having problems with gcc, see Prof. Conrad for help; he has some new information on how to fix that. (2) Machine language... a.out is in machine language machine language is "binary codes" that correspond to instructions like "add", "multiply", "compare". The compiler (cc or gcc) converts from C into machine langauge. You can also specify a different file name for the machine language by writing: cc -o fred lab01a.c In that case, instead of putting the machine langauge (the binary) into a.out, it gets put into a file named "fred". To run it you would type: ./fred But fred is a silly name... instead, if the file is foo.c, we usually name the binary foo. If the file is bar.c, we would name the binary exectuable file: bar If you type "make fum", the system looks for a file fum.c If one exists, it will compile with the command: cc -o fum fum.c You can also write a "Makefile" that specifies rules for what happens when you just type "make". Typically, with a Makefile, if you type make clean then the binaries get deleted to save space. You can always bring them back later by typing "make" again. If you type make more than once, the second time it has no effect, unless the .c files have been changed since the last time you typed make. YOu can read more about "make" and "Makefiles" in one of the appendices of your Andersen text. Now: seg faults... if you have a mismatch between the type of a variable and the format specifier... you can get a segmentation fault Three files are in the directory that show three different conditions that can cause segmentation faults. Take a look at them. ******************