git: 9de71f358bb9 - 2021Q4 - sysutils/reptyr: Fix buld under LLVM 13 on FreeBSD

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Fri, 10 Dec 2021 04:42:08 UTC
The branch 2021Q4 has been updated by cy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9de71f358bb9ac9fb611e9ffc5099eb607f9633b

commit 9de71f358bb9ac9fb611e9ffc5099eb607f9633b
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-12-02 04:03:49 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2021-12-10 04:35:03 +0000

    sysutils/reptyr: Fix buld under LLVM 13 on FreeBSD
    
    Fix the following error under LLVM 13 on FreeBSD.
    
    In file included from platform/freebsd/freebsd_ptrace.c:69:
    In file included from platform/freebsd/arch/amd64.h:23:
    platform/freebsd/arch/x86_common.h:45:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
            int ret;
                ^
    platform/freebsd/arch/x86_common.h:54:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
            int ret;
                ^
    2 errors generated.
    
    This patch has been submitted to upstream in pull request
    https://github.com/nelhage/reptyr/pull/134.
    
    (cherry picked from commit db939cf00140485662e03f3fe6c6f50277448001)
---
 .../patch-platform_freebsd_arch_x86__common.h      | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/sysutils/reptyr/files/patch-platform_freebsd_arch_x86__common.h b/sysutils/reptyr/files/patch-platform_freebsd_arch_x86__common.h
new file mode 100644
index 000000000000..7263e4e74dc4
--- /dev/null
+++ b/sysutils/reptyr/files/patch-platform_freebsd_arch_x86__common.h
@@ -0,0 +1,27 @@
+--- platform/freebsd/arch/x86_common.h.orig	2020-09-29 14:29:59.000000000 -0700
++++ platform/freebsd/arch/x86_common.h	2021-12-01 19:58:27.954536000 -0800
+@@ -42,21 +42,19 @@
+ }
+ 
+ static inline unsigned long arch_get_register(struct ptrace_child *child, unsigned long oft){
+-	int ret;
+ 	struct reg regs;
+ 
+-	ret = ptrace_command(child, PT_GETREGS, &regs);
++	(void) ptrace_command(child, PT_GETREGS, &regs);
+ 
+ 	return *ptr(&regs,oft);
+ }
+ 
+ static inline void arch_set_register(struct ptrace_child *child, unsigned long oft, unsigned long val){
+-	int ret;
+ 	struct reg regs;
+ 
+-	ret = ptrace_command(child, PT_GETREGS, &regs);
++	(void) ptrace_command(child, PT_GETREGS, &regs);
+ 	*ptr(&regs,oft)=val;
+-	ret = ptrace_command(child, PT_SETREGS, &regs);
++	(void) ptrace_command(child, PT_SETREGS, &regs);
+ }
+ 
+ static inline int arch_save_syscall(struct ptrace_child *child) {