Skip to content

Return value of system(...) ignored #281

@davidrohr

Description

@davidrohr

Compiling FairMQ yields the following warning

2020-06-17@13:51:32:DEBUG:O2:FairMQ:0: /home/qon/alice/sw/SOURCES/FairMQ/c60dd9965c/0/fairmq/sdk/DDSEnvironment.cxx: In member function 'void fair::mq::sdk::DDSEnvironment::Impl::SetupConfigHome()':
2020-06-17@13:51:32:DEBUG:O2:FairMQ:0: /home/qon/alice/sw/SOURCES/FairMQ/c60dd9965c/0/fairmq/sdk/DDSEnvironment.cxx:69:20: warning: ignoring return value of 'int system(const char*)', declared with attribute warn_unused_result [-Wunused-result]
2020-06-17@13:51:32:DEBUG:O2:FairMQ:0:    69 |         std::system(cmd.str().c_str());
2020-06-17@13:51:32:DEBUG:O2:FairMQ:0:       |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

because it is not checked whether the command called via std::system ran correctly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions