Newsgroups: cmu.cs.class.cs347(Organization: Carnegie Mellon University'Subject: Getting GCC to compile etime.c

Some of the students using the file "etime.c" from Asst. 1 to do their timing have discovered that GCC gives an error message on this code.  Turns out that our installation of GCC doesn't have the latest set of "include" files.  We're trying to get the installation updated.
In the meantime, here's a work around: for any file that contains the line:
    #include <sys/time.h>
include the flags "-nostdinc -I/usr/include" on the command line for gcc.
For example, I can compile the code in Asst 1 using the following incantation:
    make example CC=gcc CFLAGS="-O -nostdinc -I/usr/include"
You'll get some scary looking warning messages from the linker (ld), but my code seems to run OK anyhow.
As Todd mentioned earlier, you can use CC instead of GCC and bypass all of these problems.  However, we've found the assembly code generated by GCC to be more readable than that generated by CC.
Randy Bryant
Computer Science Dept.
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-8821
[email-masked]
http://www.cs.cmu.edu/~bryant