Machine-translated by Google. Questions are authored in English.
Top

Discussion

Determining that a name is never used requires the compiler to

  • A.compile the program twice and compare the two results
  • B.consult the linker after the object file has been produced
  • C.execute the program and observe which names are accessed
  • D.record uses against the entry as the program is processed

Answer: D

A simple flag or counter on the entry suffices. The check is made when the scope closes, at which point no further use of that declaration is possible. The same flag also supports warnings about variables assigned but never read.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.