You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to avoid/reduce leaks by the compiler of the hidden code. #10
Upon compiler errors, the error messages often leak some of the hidden code. Typically, if the student forget the trailing ';' in his code, the error message will display the next line where the compiler detected the error.
This could be exploited by students to cheat, but that's a minor bother for now. What's more annoying is that it confuses students making them think that they need to introduce some of that code in their answer to fix it.
Could we insert some dummy intermediate code that would trigger the error, but not reveal confusing information?
int main() {
int r
{}
}
g++ bla.cc
bla.cc: In function ‘int main()’:
bla.cc:6:5: error: expected ‘,’ or ‘;’ before ‘{’ token
{}
^
Or maybe we should just be using clang which tends to be better with error messages:
clang++ bla.cc
bla.cc:3:10: error: expected ';' at end of declaration
int r
^
;
1 error generated.
Activity