summarylogtreecommitdiffstats
path: root/0025-rxgen-Declare-generated-PKG_OpCodeStats.patch
blob: e74a7bfb82147c9f19281422a111fac44291adcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From 53c988023e7e6087026d6ed795ed4a13ea39cb94 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Tue, 5 Mar 2024 07:40:08 -0700
Subject: [PATCH 25/29] rxgen: Declare generated PKG_OpCodeStats()

The function {PKG}_OpCodeStats() is generated by rxgen, however a
prototype for the function is not generated.

The functions h_ProcMainBody_setup() and h_HeadofOldStyleProc_setup()
in rpc_parse.c emit prototypes for {PKG}_ExecuteRequest() and
{PKG}_TranslateOpCode(), but do not emit a prototype for
{PKG}_OpCodeStats().

Update rxgen to emit a function prototype for {PKG}_OpCodeStats() in the
generated header file.

Use a variable to point to "PackagePrefix[PackageIndex]" in
h_ProcMainBody_setup to improve readability.

{PKG}_OpCodeStats(), specifically RXSTATS_OpCodeStats(), is flagged due
to a missing prototype when building against a Linux 6.8 kernel (which
sets the -Wmissing-declarations and -Wmissing-prototypes compiler flags
as default). Linux 6.8 commit:  'Makefile.extrawarn: turn on
missing-prototypes globally' (0fcb70851f). When building against a
kernel with CONFIG_WERROR=y, the build fails.

Reviewed-on: https://gerrit.openafs.org/15631
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 26bb4d143b31ba027cf2721ac731df67a174c43b)

Change-Id: I9072d22d142b5b7a2f59b0cfc4026066ef1d9501
---
 src/rxgen/rpc_parse.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c
index 59854f4d5..e648a6600 100644
--- a/src/rxgen/rpc_parse.c
+++ b/src/rxgen/rpc_parse.c
@@ -2148,10 +2148,14 @@ er_TailofOldStyleProc_setup(void)
 static void
 h_ProcMainBody_setup(void)
 {
+    char *pprefix = PackagePrefix[PackageIndex];
     f_print(fout,"\nextern int %s%sExecuteRequest(struct rx_call *);\n",
-	    prefix, PackagePrefix[PackageIndex]);
+	    prefix, pprefix);
     f_print(fout,"extern char * %s%sTranslateOpCode(int op);\n", prefix,
-	    PackagePrefix[PackageIndex]);
+	    pprefix);
+    f_print(fout,"extern struct %s%sstats *%s%sOpCodeStats(int op);\n",
+	    prefix, pprefix,
+	    prefix, pprefix);
 }
 
 static void
@@ -2165,6 +2169,8 @@ h_HeadofOldStyleProc_setup(void)
     f_print(fout,"\nextern int %sOpCodeIndex(int op);\n", PackagePrefix[PackageIndex]);
     f_print(fout, "extern char * %s%sTranslateOpCode(int op);\n",
 	    prefix, pprefix);
+    f_print(fout, "extern struct %s%sstats *%s%sOpCodeStats(int op);\n",
+	    prefix, pprefix, prefix, pprefix);
 }
 
 void
-- 
2.44.0