-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to deal with warning of gcc #354
Conversation
P.S. I'm wondering if it is possible to judge whether the compilation is success only by the exitcode. I don't use other language besides C++, but in my test, it's ok to do this in g++. i.e. Can the code be rewritten to the following? compiler.on('exit', (exitcode) => {
- if (exitcode === 1 || error !== '') {
+ if (exitcode === 1) {
ocWrite('Errors while compiling:\n' + error);
ocShow();
console.error('Compilation failed');
resolve(false);
getJudgeViewProvider().extensionToJudgeViewMessage({
command: 'compiling-stop',
});
getJudgeViewProvider().extensionToJudgeViewMessage({
command: 'not-running',
});
return;
}
+ if (error !== '') {
+ ocWrite('Warnings while compiling:\n' + error);
+ ocShow();
+ }
console.log('Compilation passed');
getJudgeViewProvider().extensionToJudgeViewMessage({
command: 'compiling-stop',
});
resolve(true);
return;
});
});
return result;
}; |
Can u please explain your scenario? |
i think we should keep checking the error and the exit code |
The scenario is explained in the previous comment. When you enable |
Hi @linlexiao0 . sorry i wrongly tagged u. I meant to mention @hieupham1103 on their scenario |
how to add this to my cph in vscode |
This will solve issue #214, #274.
If the exit code of the compiler is 0, and the STDERR is not empty, then we will consider the output of the STDERR is warning message, and the compilation will not be halted, the console will still be displayed with the message "Warnings while compiling".
The function will only be enabled if the new option "Zero Exit Code Is Warning" is enabled in the setting.