Matthew Lien <[email protected]> skribis:
> nix/nix-daemon/guix-daemon.cc: In function ‘error_t parse_opt(int, char*,
> argp_state*)’:
> nix/nix-daemon/guix-daemon.cc:174:14: error: invalid conversion from ‘int’ to
> ‘error_t {aka __error_t_codes}’ [-fpermissive]
> return ARGP_ERR_UNKNOWN;
> ^
> nix/nix-daemon/guix-daemon.cc:177:10: error: invalid conversion from ‘int’ to
> ‘error_t {aka __error_t_codes}’ [-fpermissive]
> return 0;
> ^
Could you try changing lines 174 and 177 like this:
diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc
index 5f0710c..e2c30e7 100644
--- a/nix/nix-daemon/guix-daemon.cc
+++ b/nix/nix-daemon/guix-daemon.cc
@@ -171,10 +171,10 @@ parse_opt (int key, char *arg, struct argp_state *state)
settings.thisSystem = arg;
break;
default:
- return ARGP_ERR_UNKNOWN;
+ return (error_t) ARGP_ERR_UNKNOWN;
}
- return 0;
+ return (error_t) 0;
}
/* Argument parsing. */
This is not a problem on GNU/Linux where argp.h does this:
#ifndef __error_t_defined
typedef int error_t;
# define __error_t_defined
#endif
... whereas on GNU/Hurd ‘error_t’ is a enum, and is always defined:
typedef enum __error_t_codes error_t;
TIA,
Ludo’.