Skip to content
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 warning flags and fix warnings #1111

Merged
merged 3 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,12 @@ workspaces
wp
writelines
WRONLY
Wconversion
Wformat
Woverloaded
Wshadow
Wsign
Wundef
wrs
WSL
www
Expand Down
2 changes: 1 addition & 1 deletion Os/Task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace Os {
TaskStatus start(const Fw::StringBase &name, taskRoutine routine, void* arg, NATIVE_UINT_TYPE priority = TASK_DEFAULT, NATIVE_UINT_TYPE stackSize = TASK_DEFAULT, NATIVE_UINT_TYPE cpuAffinity = TASK_DEFAULT, NATIVE_UINT_TYPE identifier = TASK_DEFAULT); //!< start the task

// Deprecated: only the name, routine, and argument are **required** parameters. This ordering of parameters is therefore inappropriate and will be removed in the future
DEPRECATED(TaskStatus start(const Fw::StringBase &name, NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, taskRoutine routine, void* arg, NATIVE_INT_TYPE cpuAffinity = TASK_DEFAULT),
DEPRECATED(TaskStatus start(const Fw::StringBase &name, NATIVE_INT_TYPE identifier, NATIVE_INT_TYPE priority, NATIVE_INT_TYPE stackSize, taskRoutine routine, void* arg, NATIVE_INT_TYPE cpuAffinity = static_cast<NATIVE_INT_TYPE>(TASK_DEFAULT)),
"Please switch to start(Fw::StringBase &name, taskRoutine routine, void* arg, NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE stackSize, NATIVE_UINT_TYPE cpuAffinity, NATIVE_UINT_TYPE identifier)"); //!< start the task
I32 getIdentifier(); //!< get the identifier for the task
static TaskId getOsIdentifier(); //Gets the Os Task ID. Useful for passive components.
Expand Down
19 changes: 18 additions & 1 deletion Ref/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,21 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Top/")
set(SOURCE_FILES "${CMAKE_CURRENT_LIST_DIR}/Top/Main.cpp")
set(MOD_DEPS ${PROJECT_NAME}/Top)

register_fprime_deployment()
register_fprime_deployment()
if (NOT FPRIME_FPP_LOCS_BUILD)
# The following compile options will only apply to the deployment executable.
# The extra warnings trigger in core F Prime so we don't apply them there.
target_compile_options("${PROJECT_NAME}" PUBLIC -Wall)
target_compile_options("${PROJECT_NAME}" PUBLIC -Wextra)
target_compile_options("${PROJECT_NAME}" PUBLIC -Werror)
#target_compile_options("${PROJECT_NAME}" PUBLIC -Wshadow)
target_compile_options("${PROJECT_NAME}" PUBLIC -Wconversion)
target_compile_options("${PROJECT_NAME}" PUBLIC -Wsign-conversion)
target_compile_options("${PROJECT_NAME}" PUBLIC -Wformat-security)
target_compile_options("${PROJECT_NAME}" PUBLIC -Wnon-virtual-dtor)
target_compile_options("${PROJECT_NAME}" PUBLIC -Wold-style-cast)
target_compile_options("${PROJECT_NAME}" PUBLIC -Woverloaded-virtual)
target_compile_options("${PROJECT_NAME}" PUBLIC -Wno-unused-parameter)
target_compile_options("${PROJECT_NAME}" PUBLIC -Wundef)
set_property(TARGET "${PROJECT_NAME}" PROPERTY CXX_STANDARD 11)
endif()
6 changes: 1 addition & 5 deletions Ref/Top/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ int main(int argc, char* argv[]) {
char *hostname;
option = 0;
hostname = nullptr;
bool dump = false;

while ((option = getopt(argc, argv, "hdp:a:")) != -1){
switch(option) {
Expand All @@ -53,16 +52,13 @@ int main(int argc, char* argv[]) {
return 0;
break;
case 'p':
port_number = atoi(optarg);
port_number = static_cast<U32>(atoi(optarg));
break;
case 'a':
hostname = optarg;
break;
case '?':
return 1;
case 'd':
dump = true;
break;
default:
print_usage(argv[0]);
return 1;
Expand Down