1 /* { dg-additional-options "-Wno-analyzer-too-complex" } */
3 extern char *strdup (const char *__s
)
4 __attribute__ ((__nothrow__
, __leaf__
, __malloc__
, __nonnull__ (1)));
6 extern void abort (void)
7 __attribute__ ((__nothrow__
, __leaf__
, __noreturn__
));
9 extern int getopt (int ___argc
, char *const *___argv
, const char *__shortopts
)
10 __attribute__ ((__nothrow__
, __leaf__
, __nonnull__ (2, 3)));
13 extern void free (void *__ptr
)
14 __attribute__ ((__nothrow__
, __leaf__
));
20 const char *state_dir_prefix
;
23 static inline char *xstrdup(const char *s
) {
24 char *val
= strdup(s
);
30 int config_init(struct state
*config
);
32 int main(int argc
, char *argv
[]) {
34 struct state state
= { 0 };
38 while ((rc
= getopt(argc
, argv
, "H:p:")) != -1) {
41 free((void*)state
.host
);
42 state
.host
= xstrdup(optarg
);
45 free((void*)state
.port
);
46 state
.port
= xstrdup(optarg
);
51 free((void*)state
.host
);
52 free((void*)state
.port
);