Skip to content

Commit

Permalink
Merge pull request #53 from chermehdi/add/cpp-flags
Browse files Browse the repository at this point in the history
add extra debuggin flags for c++ runner
  • Loading branch information
Eroui authored Dec 24, 2020
2 parents 733bea1 + 433d816 commit 51bed63
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ func (judge *CppJudge) hasLibraryLocation() bool {
// We expect fileName to be: main.cpp or main_gen.cpp.
func (judge *CppJudge) compile(currentDir, fileName string) error {
var stderrBuffer bytes.Buffer
cmd := exec.Command("g++", "--std=c++14", fileName, "-o", "work/sol")
cmd := exec.Command("g++", "--std=c++14", fileName, "-o", "work/sol", "-Wall", "-Wextra",
"-Wshadow", "-D_GLIBCXX_DEBUG", "-D_GLIBCXX_DEBUG_PEDANTIC")
cmd.Dir = currentDir
cmd.Stderr = &stderrBuffer
if err := cmd.Run(); err != nil {
Expand Down

0 comments on commit 51bed63

Please sign in to comment.