Add -Wextra option

This commit is contained in:
Serge Lamikhov-Center 2022-01-14 20:49:23 +02:00
parent b05d43860b
commit 7ab1112907
4 changed files with 34 additions and 9 deletions

33
.vscode/launch.json vendored
View File

@ -33,7 +33,9 @@
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/examples/elfdump/elfdump",
"args": ["tests/elf_examples/hello_32"],
"args": [
"tests/elf_examples/hello_32"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
@ -55,10 +57,10 @@
"request": "launch",
"program": "${workspaceFolder}/build/examples/proc_mem/proc_mem",
"args": [
"2919",
"11706",
"/usr/bin/bash"
],
"sudo" : true,
"sudo": true,
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
@ -71,7 +73,30 @@
"ignoreFailures": true
}
],
"miDebuggerPath": "/home/user/ELFIO/examples/proc_mem/sudo_gdb.sh"
"miDebuggerPath": "/home/user/ELFIO/examples/sudo_gdb.sh"
},
{
"name": "Run dump for /proc/kcore",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/examples/elfdump/elfdump",
"args": [
"/proc/kcore"
],
"sudo": true,
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"miDebuggerPath": "/home/user/ELFIO/examples/sudo_gdb.sh"
}
]
}

View File

@ -44,12 +44,12 @@ if (ELFIO_BUILD_EXAMPLES OR ELFIO_BUILD_TESTS)
endif()
if (ELFIO_BUILD_EXAMPLES)
set (CMAKE_CXX_FLAGS "-Wall")
set (CMAKE_CXX_FLAGS "-Wall -Wextra")
add_subdirectory(examples)
endif()
if (ELFIO_BUILD_TESTS AND IS_TOP_PROJECT)
set (CMAKE_CXX_FLAGS "-Wall")
set (CMAKE_CXX_FLAGS "-Wall -Wextra")
enable_testing()
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} USES_TERMINAL)
add_subdirectory(tests)

View File

@ -1,3 +0,0 @@
# The file is used for VSCode debugging ability. Use it as following:
# "miDebuggerPath": "/home/user/ELFIO/examples/proc_mem/sudo_gdb.sh"
sudo /usr/bin/gdb "$@"

3
examples/sudo_gdb.sh Executable file
View File

@ -0,0 +1,3 @@
# The file is used for VSCode debugging with sudo. Use it as following:
# "miDebuggerPath": "/home/user/ELFIO/examples/sudo_gdb.sh"
sudo /usr/bin/gdb "$@"