From: Dmitry V. Levin Date: Sun, 12 Feb 2017 19:14:15 +0000 (+0000) Subject: Fix -Werror=duplicate-decl-specifier compilation issues X-Git-Tag: v4.16~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2063341fefe66517197afcbeee2e6e1ab1253767;p=strace Fix -Werror=duplicate-decl-specifier compilation issues capability.c:82:28: error: duplicate "const" declaration specifier capability.c:110:33: error: duplicate "const" declaration specifier rt_tgsigqueueinfo.c:42:61: error: duplicate "const" declaration specifier utime.c:66:23: error: duplicate "const" declaration specifier waitid.c:147:20: error: duplicate "const" declaration specifier * capability.c (cap_user_header_t, cap_user_data_t): Remove. (get_cap_header): Change return type to "const struct user_cap_header_struct *". (print_cap_header, print_cap_data): Change the type of last argument to "const struct user_cap_header_struct * const". (SYS_FUNC(capget)): Change type of "h" variable to "const struct user_cap_header_struct *". (SYS_FUNC(capset)): Change type of "h" variable to "const struct user_cap_header_struct * const". * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Change the type of last argument to "const void *const". * tests/utime.c (main): Change the type of "tail_u" variable to "const struct utimbuf *const". * tests/waitid.c (do_waitid): Change the type of 3rd argument to "const siginfo_t *const". --- diff --git a/capability.c b/capability.c index b7a510bd..a3f06ea3 100644 --- a/capability.c +++ b/capability.c @@ -52,18 +52,18 @@ enum { #include "xlat/cap_version.h" -typedef struct user_cap_header_struct { +struct user_cap_header_struct { uint32_t version; int pid; -} *cap_user_header_t; +}; -typedef struct user_cap_data_struct { +struct user_cap_data_struct { uint32_t effective; uint32_t permitted; uint32_t inheritable; -} *cap_user_data_t; +}; -static cap_user_header_t +static const struct user_cap_header_struct * get_cap_header(struct tcb *const tcp, const kernel_ulong_t addr) { static struct user_cap_header_struct header; @@ -79,7 +79,7 @@ get_cap_header(struct tcb *const tcp, const kernel_ulong_t addr) static void print_cap_header(struct tcb *const tcp, const kernel_ulong_t addr, - const cap_user_header_t const h) + const struct user_cap_header_struct *const h) { if (!addr || !h) { printaddr(addr); @@ -107,7 +107,7 @@ print_cap_bits(const uint32_t lo, const uint32_t hi) static void print_cap_data(struct tcb *const tcp, const kernel_ulong_t addr, - const cap_user_header_t const h) + const struct user_cap_header_struct *const h) { struct user_cap_data_struct data[2]; unsigned int len; @@ -137,7 +137,7 @@ print_cap_data(struct tcb *const tcp, const kernel_ulong_t addr, SYS_FUNC(capget) { - cap_user_header_t h; + const struct user_cap_header_struct *h; if (entering(tcp)) { h = get_cap_header(tcp, tcp->u_arg[0]); @@ -152,7 +152,8 @@ SYS_FUNC(capget) SYS_FUNC(capset) { - cap_user_header_t h = get_cap_header(tcp, tcp->u_arg[0]); + const struct user_cap_header_struct *const h = + get_cap_header(tcp, tcp->u_arg[0]); print_cap_header(tcp, tcp->u_arg[0], h); tprints(", "); print_cap_data(tcp, tcp->u_arg[1], h); diff --git a/tests/rt_tgsigqueueinfo.c b/tests/rt_tgsigqueueinfo.c index d0500c32..ec093481 100644 --- a/tests/rt_tgsigqueueinfo.c +++ b/tests/rt_tgsigqueueinfo.c @@ -39,7 +39,7 @@ # include static long -k_tgsigqueueinfo(const pid_t pid, const int sig, const void const *info) +k_tgsigqueueinfo(const pid_t pid, const int sig, const void *const info) { return syscall(__NR_rt_tgsigqueueinfo, (unsigned long) 0xffffffff00000000ULL | pid, diff --git a/tests/utime.c b/tests/utime.c index b81256c8..8fd594f0 100644 --- a/tests/utime.c +++ b/tests/utime.c @@ -63,7 +63,7 @@ main(void) const time_t t = time(NULL); const struct tm * const p = localtime(&t); const struct utimbuf u = { .actime = t, .modtime = t }; - const struct utimbuf const *tail_u = tail_memdup(&u, sizeof(u)); + const struct utimbuf *const tail_u = tail_memdup(&u, sizeof(u)); const char *const dummy_filename = tail_memdup(dummy_str, sizeof(dummy_str) - 1); diff --git a/tests/waitid.c b/tests/waitid.c index 6df25da6..6a102990 100644 --- a/tests/waitid.c +++ b/tests/waitid.c @@ -144,7 +144,7 @@ poison(unsigned int v) static long do_waitid(const unsigned int idtype, const unsigned int id, - const siginfo_t const *infop, + const siginfo_t *const infop, const unsigned int options, const struct rusage *const rusage) {