Skip to content

Commit

Permalink
Add -Wextra-semi to debug builds (#1789)
Browse files Browse the repository at this point in the history
* Add -Wextra-semi to debug builds

* Add missing fix
  • Loading branch information
tklengyel authored Apr 27, 2024
1 parent 643c06d commit fc91516
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 31 deletions.
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ if get_option('buildtype').startswith('debug')
add_project_arguments('-Wfloat-equal', language : ['cpp'])
add_project_arguments('-Wundef', language : ['cpp'])
add_project_arguments('-Wvla', language : ['cpp'])
add_project_arguments('-Wextra-semi', language : ['c', 'cpp'])
add_project_arguments('-ftrivial-auto-var-init=pattern', language: ['c', 'cpp'])
elif get_option('hardening')
# Runtime hardening for release builds
Expand Down
2 changes: 1 addition & 1 deletion src/drakvuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static bool is_terminated(drakvuf_t drakvuf, void* data)
return drakvuf_is_interrupted(drakvuf) ||
(info->proc->find(info->pid) != info->proc->end() &&
info->proc->at(info->pid));
};
}

void drakvuf_c::terminate(vmi_pid_t injection_pid,
uint32_t injection_tid,
Expand Down
2 changes: 1 addition & 1 deletion src/libdrakvuf/drakvuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ static bool inject_trap_io(drakvuf_t drakvuf, drakvuf_trap_t* trap)

drakvuf->io = g_slist_prepend(drakvuf->io, trap);
return 1;
};
}

static bool _drakvuf_add_trap(drakvuf_t drakvuf, drakvuf_trap_t* trap)
{
Expand Down
2 changes: 1 addition & 1 deletion src/libdrakvuf/linux-processes.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ int64_t linux_get_process_userid(drakvuf_t drakvuf, addr_t process_base)
return -1;

return uid;
};
}

int64_t linux_get_current_process_userid(drakvuf_t drakvuf, drakvuf_trap_info_t* info)
{
Expand Down
4 changes: 2 additions & 2 deletions src/libdrakvuf/win-processes.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ int64_t win_get_process_userid(drakvuf_t drakvuf, addr_t eprocess_base)
PRINT_DEBUG("The process at 0x%" PRIx64 " has a userid larger then INT_MAX!\n", eprocess_base);

return (int64_t)userid;
};
}

unicode_string_t* win_get_process_csdversion(drakvuf_t drakvuf, addr_t eprocess_base)
{
Expand All @@ -554,7 +554,7 @@ unicode_string_t* win_get_process_csdversion(drakvuf_t drakvuf, addr_t eprocess_
return NULL;

return drakvuf_read_unicode_va(drakvuf, csdversion_va, 0);
};
}

int64_t win_get_current_process_userid(drakvuf_t drakvuf, drakvuf_trap_info_t* info)
{
Expand Down
2 changes: 1 addition & 1 deletion src/libhook/hooks/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace libhook

BaseHook::BaseHook(drakvuf_t drakvuf)
: drakvuf_(drakvuf)
{};
{}

BaseHook::BaseHook(BaseHook&& rhs) noexcept
{
Expand Down
2 changes: 1 addition & 1 deletion src/libhook/hooks/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ class BaseHook
drakvuf_t drakvuf_ = nullptr;
};

}; // namespace libhook
} // namespace libhook
2 changes: 1 addition & 1 deletion src/libhook/hooks/catchall.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@ auto CatchAllHook::create(drakvuf_t drakvuf, cb_wrapper_t cb, int ttl)
return hook;
}

}; // namespace libhook
} // namespace libhook
2 changes: 1 addition & 1 deletion src/libhook/hooks/cpuid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@ auto CpuidHook::create(drakvuf_t drakvuf, cb_wrapper_t cb, int ttl)
return hook;
}

}; // namespace libhook
} // namespace libhook
2 changes: 1 addition & 1 deletion src/libhook/hooks/cr3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,4 @@ auto Cr3Hook::create(drakvuf_t drakvuf, cb_wrapper_t cb, int ttl)
return hook;
}

}; // namespace libhook
} // namespace libhook
2 changes: 1 addition & 1 deletion src/libhook/hooks/manual.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ class ManualHook : public BaseHook

};

}; // namespace libhook
} // namespace libhook
2 changes: 1 addition & 1 deletion src/libhook/hooks/memaccess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,4 @@ auto MemAccessHook::create(drakvuf_t drakvuf, cb_wrapper_t cb, addr_t gfn, memac
return hook;
}

}; // namespace libhook
} // namespace libhook
2 changes: 1 addition & 1 deletion src/plugins/apimon/apimon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ struct ApimonReturnHookData : PluginResult
hook_target_entry_t* target = nullptr;
};

};
}

static uint64_t make_hook_id(const drakvuf_trap_info_t* info)
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/callbackmon/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,4 @@ static const char* offset_miniport_names[__OFFSET_MINIPORT_MAX][2] =
[NDIS_MINIPORT_BLOCK_SYNCHRONOUSRETURNPACKETHANDLER] = { "_NDIS_MINIPORT_BLOCK", "SynchronousReturnPacketHandler" },
[NDIS_MINIPORT_BLOCK_TOPNDIS5PACKETINDICATEHANDLER] = { "_NDIS_MINIPORT_BLOCK", "TopNdis5PacketIndicateHandler" }
};
};
}
2 changes: 1 addition & 1 deletion src/plugins/etwmon/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,4 @@ struct provider_t

provider_t(etwmon* plugin, vmi_instance_t vmi, addr_t base);
};
};
}
2 changes: 1 addition & 1 deletion src/plugins/fileextractor/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,5 +501,5 @@ struct FILE_FS_DEVICE_INFORMATION

// TODO Move into "task_t" as "MAX_READ_BYTES"
static const uint64_t BYTES_TO_READ = 0x10000;
};
}
#endif // FILEDELETE_PRIVATE_H
2 changes: 1 addition & 1 deletion src/plugins/helpers/hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class PluginResult : public libhook::CallResult
public:
PluginResult()
: libhook::CallResult()
{};
{}

class pluginex* plugin_ = nullptr;
};
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/hidsim/hidsim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ hidsim::hidsim(drakvuf_t drakvuf, const hidsim_config* config) :
hidsim::~hidsim()
{
this->stop();
};
}

bool hidsim::stop_impl()
{
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/linkmon/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,5 @@ static const char* offset_names_2[__OFFSET_MAX][2] =
[REPARSE_DATA_BUFFER_SUBSTITUTENAMELENGTH_SYMLINK] = {"_REPARSE_DATA_BUFFER::<anonymous-tag>::<unnamed-type-SymbolicLinkReparseBuffer>", "SubstituteNameLength"},
[REPARSE_DATA_BUFFER_PATHBUFFER_SYMLINK] = {"_REPARSE_DATA_BUFFER::<anonymous-tag>::<unnamed-type-SymbolicLinkReparseBuffer>", "PathBuffer"},
};
};
#endif // LINKMON_PRIVATE_H
}
#endif // LINKMON_PRIVATE_H
4 changes: 2 additions & 2 deletions src/plugins/plugins_ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ char ERROR_MSG_ADDING_TRAP[] = "Failed to add a trap";

pluginex::pluginex(drakvuf_t drakvuf, output_format_t output)
: m_output_format(output), drakvuf(drakvuf)
{};
{}

pluginex::~pluginex()
{
stop();
};
}

bool pluginex::stop_impl()
{
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/plugins_ex.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ struct call_result_t
{}

virtual ~call_result_t()
{};
{}

void set_result_call_params(const drakvuf_trap_info_t* info)
{
Expand Down Expand Up @@ -448,12 +448,12 @@ struct plugin_data

plugin_data(pluginex* plugin, call_result_t* params)
: plugin(plugin), params(params)
{};
{}

virtual ~plugin_data()
{
delete params;
};
}
};

class pluginex : public plugin
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/ptracemon/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,6 @@ static inline const char* ptrace_request_to_str(ptrace_request_t request)
}
return NULL;
}
}; // ptracemon_ns
} // ptracemon_ns

#endif
#endif
2 changes: 1 addition & 1 deletion src/plugins/rootkitmon/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,6 @@ struct filter_cb_t
return base_addr < other.base_addr;
}
};
};
}

#endif
4 changes: 2 additions & 2 deletions src/plugins/syscalls/private_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ class syscalls_base : public pluginex
virtual char* win_extract_string(drakvuf_t drakvuf, drakvuf_trap_info_t* info, const syscalls_ns::arg_t& arg, addr_t val)
{
return NULL;
};
}

syscalls_base(drakvuf_t drakvuf, const syscalls_config* config, output_format_t output);
syscalls_base(const syscalls_base&) = delete;
syscalls_base& operator=(const syscalls_base&) = delete;
};

#endif
#endif
2 changes: 1 addition & 1 deletion src/plugins/wmimon/wmimon.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class wmimon: public pluginex
~wmimon()
{
delete[] m_offsets;
};
}

const size_t* Offsets() const
{
Expand Down

0 comments on commit fc91516

Please sign in to comment.