Skip to content

enable pedantic warnings as errors #487

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

Merged
merged 3 commits into from
Nov 24, 2023
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
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.10)

project(ROSProjectManager VERSION 12.0)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Werror -Wall -Wextra -Wpedantic -Wsuggest-override)
endif()

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_link_options("-Wl,-z,relro,-z,now,-z,defs")
endif()
Expand Down
14 changes: 7 additions & 7 deletions src/project_manager/ros_build_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,39 @@ void ROSBuildSystem::triggerParsing()
guardParsingRun().markAsSuccess();
}

bool ROSBuildSystem::addFiles(ProjectExplorer::Node *context, const Utils::FilePaths &filePaths, Utils::FilePaths *notAdded)
bool ROSBuildSystem::addFiles(ProjectExplorer::Node *context, const Utils::FilePaths &/*filePaths*/, Utils::FilePaths */*notAdded*/)
{
// update entire workspace project
dynamic_cast<ROSProject *>(context->getProject())->refresh();
return true;
}

ProjectExplorer::RemovedFilesFromProject ROSBuildSystem::removeFiles(ProjectExplorer::Node *context, const Utils::FilePaths &filePaths, Utils::FilePaths *notRemoved)
ProjectExplorer::RemovedFilesFromProject ROSBuildSystem::removeFiles(ProjectExplorer::Node */*context*/, const Utils::FilePaths &/*filePaths*/, Utils::FilePaths */*notRemoved*/)
{
return ProjectExplorer::RemovedFilesFromProject::Ok;
}

bool ROSBuildSystem::deleteFiles(ProjectExplorer::Node *context, const Utils::FilePaths &filePaths)
bool ROSBuildSystem::deleteFiles(ProjectExplorer::Node */*context*/, const Utils::FilePaths &/*filePaths*/)
{
return true;
}

bool ROSBuildSystem::canRenameFile(ProjectExplorer::Node *context, const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath)
bool ROSBuildSystem::canRenameFile(ProjectExplorer::Node */*context*/, const Utils::FilePath &/*oldFilePath*/, const Utils::FilePath &/*newFilePath*/)
{
return true;
}

bool ROSBuildSystem::renameFile(ProjectExplorer::Node *context, const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath)
bool ROSBuildSystem::renameFile(ProjectExplorer::Node */*context*/, const Utils::FilePath &/*oldFilePath*/, const Utils::FilePath &/*newFilePath*/)
{
return true;
}

bool ROSBuildSystem::addDependencies(ProjectExplorer::Node *context, const QStringList &dependencies)
bool ROSBuildSystem::addDependencies(ProjectExplorer::Node */*context*/, const QStringList &/*dependencies*/)
{
return true;
}

bool ROSBuildSystem::supportsAction(ProjectExplorer::Node *context, ProjectExplorer::ProjectAction action, const ProjectExplorer::Node *node) const
bool ROSBuildSystem::supportsAction(ProjectExplorer::Node */*context*/, ProjectExplorer::ProjectAction action, const ProjectExplorer::Node */*node*/) const
{
static const std::set<ProjectAction> possible_actions = {
ProjectAction::AddNewFile,
Expand Down
2 changes: 1 addition & 1 deletion src/project_manager/ros_project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ void ROSProject::asyncUpdateCppCodeModel(bool success)

void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo,
const Utils::FilePath projectFilePath,
const QStringList workspaceFiles,
const QStringList /*workspaceFiles*/,
const Kit *k,
const Utils::Environment &env,
const ROSUtils::PackageInfoMap wsPackageInfo,
Expand Down
2 changes: 1 addition & 1 deletion src/project_manager/ros_project_wizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ROSImportWizardPage : public Utils::WizardPage
explicit ROSImportWizardPage(QWidget *parent = 0);
~ROSImportWizardPage();

bool isComplete() const;
bool isComplete() const override;

bool forceFirstCapitalLetterForFileName() const;
void setForceFirstCapitalLetterForFileName(bool b);
Expand Down
2 changes: 1 addition & 1 deletion src/project_manager/ros_run_step.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class RunStep : public ProjectExplorer::ProjectConfiguration

virtual bool immutable() const;
virtual bool runInGuiThread() const;
virtual void cancel();
virtual void cancel() override;

void fromMap(const Utils::Store &map) override;
void toMap(Utils::Store &map) const override;
Expand Down
4 changes: 2 additions & 2 deletions src/project_manager/ros_run_steps_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class ToolWidget : public Utils::FadingPanel
public:
ToolWidget(QWidget *parent = 0);

void fadeTo(qreal value);
void setOpacity(qreal value);
void fadeTo(qreal value) override;
void setOpacity(qreal value) override;

void setRunStepEnabled(bool b);
void setUpEnabled(bool b);
Expand Down
6 changes: 3 additions & 3 deletions src/project_manager/ros_settings_page.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ class ROSSettingsPage : public Core::IOptionsPage
explicit ROSSettingsPage(QSharedPointer<ROSSettings> &settings,
QObject *parent = nullptr);

QWidget *widget();
void apply();
void finish();
QWidget *widget() override;
void apply() override;
void finish() override;

private:
const QSharedPointer<ROSSettings> m_settings;
Expand Down