VU-Programming / copp-skeleton

Project Application Development skeleton for C
Other
21 stars 50 forks source link

Added instrumentation for the exit function #37

Closed gregory-swiader closed 1 year ago

gregory-swiader commented 1 year ago
mhkarsten commented 1 year ago

I took a look at this code and tested it out on my machine it does indeed work as expected. I have a few small notes for improvement.

  1. Because of the override, a few of the test files that use exit will print the message from your hook. An easy fix as you just have to include intercept.h and change the exit() calls to orig_exit().
  2. These should be replaced in codegrade like happens with the ijvm.h i believe. Just make sure Atze (or whoever manages that) is aware.
  3. Your error message could be a bit more scary :) maybe something along the lines of "ALERT! INVALID USE OF EXIT() DETECTED. You will risk a failing grade if you submit with exit() in your code." or a "you will fail any test that triggers exit() in your code". I joke a bit, but something that makes it clear they risk failure by using it.
  4. More of a minor point, but make sure to add a "DO NOT MODIFY" comment like in ijvm.h