aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/processes.hh
diff options
context:
space:
mode:
authorLulu <lulu.berlin.2023@gmail.com>2024-10-06 22:10:40 +0200
committerLulu <lulu.berlin.2023@gmail.com>2024-10-08 01:44:38 +0000
commit43e79f443469c55ef4d3a43ce1e455d6eafcd26c (patch)
tree86e67212f01f1cf18c05b75b4321ffac6b620a1e /src/libutil/processes.hh
parent299813f324c9562b0bd6d0bc5d2114776e193d86 (diff)
Fix gcc warning -Wmissing-field-initializers
The approach that was taken here was to add default values to the type definitions rather than specify them whenever they are missing. Now the only remaining warning is '-Wunused-parameter' which @jade said is usually counterproductive and that we can just disable it: https://git.lix.systems/lix-project/lix/issues/456#issuecomment-6617 So this change adds the flags '-Wall', '-Wextra' and '-Wno-unused-parameter', so that all warnings are enabled except for '-Wunused-parameter'. Change-Id: Ic223a964d67ab429e8da804c0721ba5e25d53012
Diffstat (limited to 'src/libutil/processes.hh')
-rw-r--r--src/libutil/processes.hh10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libutil/processes.hh b/src/libutil/processes.hh
index dc09a9ba4..dd6e2978e 100644
--- a/src/libutil/processes.hh
+++ b/src/libutil/processes.hh
@@ -78,11 +78,11 @@ struct RunOptions
{
Path program;
bool searchPath = true;
- Strings args;
- std::optional<uid_t> uid;
- std::optional<uid_t> gid;
- std::optional<Path> chdir;
- std::optional<std::map<std::string, std::string>> environment;
+ Strings args = {};
+ std::optional<uid_t> uid = {};
+ std::optional<uid_t> gid = {};
+ std::optional<Path> chdir = {};
+ std::optional<std::map<std::string, std::string>> environment = {};
bool captureStdout = false;
bool mergeStderrToStdout = false;
bool isInteractive = false;