Rebuild cost after a nested header edit

A C interpreter project has eight source files: main.c, parse.c, eval.c, print.c, io.c, mem.c, hash.c and log.c. The header types.h contains the line #include "config.h". The files parse.c, eval.c and print.c include types.h, and the files main.c, eval.c and log.c include config.h directly. No other file includes either header. Compiling one source file takes 1.8 s on average, and linking takes 0.9 s. Assume compilations run sequentially, followed by one link, and ignore all other overhead. After you edit config.h, find the number of source files that must be recompiled. Also estimate the rebuild time in seconds, including the link, to one decimal place, and the time saved compared with a full build, in seconds to one decimal place.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Compiling and the Build Process Questions: