0008-Fixup-function-declarations.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. From 6255495abf4ea516aad3b447cc32d1b244229878 Mon Sep 17 00:00:00 2001
  2. From: Charlie Jenkins <charlie@rivosinc.com>
  3. Date: Fri, 4 Apr 2025 15:48:07 -0700
  4. Subject: [PATCH] Fixup function declarations
  5. GCC-15 requires function declarations to be properly typed.
  6. Upstream: dead
  7. Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
  8. ---
  9. src/bench.h | 4 ++--
  10. src/lat_rpc.c | 18 +++++++-----------
  11. src/lmdd.c | 4 ++--
  12. 3 files changed, 11 insertions(+), 15 deletions(-)
  13. diff --git a/src/bench.h b/src/bench.h
  14. index 597d068..b1624c5 100644
  15. --- a/src/bench.h
  16. +++ b/src/bench.h
  17. @@ -345,7 +345,7 @@ extern int sched_pin(int cpu);
  18. #define XACT_VERS ((u_long)1)
  19. #define RPC_XACT ((u_long)1)
  20. #define RPC_EXIT ((u_long)2)
  21. -extern char *rpc_xact_1();
  22. -extern char *client_rpc_xact_1();
  23. +extern char *rpc_xact_1(char *msg, register SVCXPRT *transp);
  24. +extern char *client_rpc_xact_1(char *argp, CLIENT *clnt);
  25. #endif /* _BENCH_H */
  26. diff --git a/src/lat_rpc.c b/src/lat_rpc.c
  27. index ff4380f..dcc24df 100644
  28. --- a/src/lat_rpc.c
  29. +++ b/src/lat_rpc.c
  30. @@ -187,16 +187,14 @@ client_rpc_xact_1(char *argp, CLIENT *clnt)
  31. */
  32. /* ARGSUSED */
  33. char *
  34. -rpc_xact_1(msg, transp)
  35. - char *msg;
  36. - register SVCXPRT *transp;
  37. +rpc_xact_1(char *msg, register SVCXPRT *transp)
  38. {
  39. static char r = 123;
  40. return &r;
  41. }
  42. -static void xact_prog_1();
  43. +static void xact_prog_1(struct svc_req *rqstp, register SVCXPRT *transp);
  44. void
  45. server_main()
  46. @@ -234,16 +232,14 @@ server_main()
  47. }
  48. static void
  49. -xact_prog_1(rqstp, transp)
  50. - struct svc_req *rqstp;
  51. - register SVCXPRT *transp;
  52. +xact_prog_1(struct svc_req *rqstp, register SVCXPRT *transp)
  53. {
  54. union {
  55. char rpc_xact_1_arg;
  56. } argument;
  57. char *result;
  58. - bool_t (*xdr_argument)(), (*xdr_result)();
  59. - char *(*local)();
  60. + bool_t (*xdr_argument)(XDR *, char *), (*xdr_result)(XDR *, char *);
  61. + char *(*local)(char *, struct svc_req *);
  62. switch (rqstp->rq_proc) {
  63. case NULLPROC:
  64. @@ -253,7 +249,7 @@ xact_prog_1(rqstp, transp)
  65. case RPC_XACT:
  66. xdr_argument = xdr_char;
  67. xdr_result = xdr_char;
  68. - local = (char *(*)()) rpc_xact_1;
  69. + local = (char *(*)(char *, struct svc_req *)) rpc_xact_1;
  70. break;
  71. case RPC_EXIT:
  72. @@ -270,7 +266,7 @@ xact_prog_1(rqstp, transp)
  73. svcerr_decode(transp);
  74. return;
  75. }
  76. - result = (*local)(&argument, rqstp);
  77. + result = (*local)((char *)&argument, rqstp);
  78. if (result != NULL && !svc_sendreply(transp, (xdrproc_t)xdr_result, result)) {
  79. svcerr_systemerr(transp);
  80. }
  81. diff --git a/src/lmdd.c b/src/lmdd.c
  82. index 529ae21..197ac46 100644
  83. --- a/src/lmdd.c
  84. +++ b/src/lmdd.c
  85. @@ -76,7 +76,7 @@ int norepeats = -1;
  86. bds_msg *m1, *m2;
  87. #endif
  88. -uint64 getarg();
  89. +uint64 getarg(char *s, int ac, char **av);
  90. int been_there(uint64 off);
  91. int getfile(char *s, int ac, char **av);
  92. @@ -162,7 +162,7 @@ main(int ac, char **av)
  93. int Fork, misses, mismatch, outpat, inpat, in, timeopen, gotcnt;
  94. int slp;
  95. uint64 skip, size, count;
  96. - void chkarg();
  97. + void chkarg(char *arg);
  98. int i;
  99. uint64 off = 0;
  100. int touch;
  101. --
  102. 2.43.0