-
Notifications
You must be signed in to change notification settings - Fork 171
Various fixes for gcc 15.x #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
c8d1224
ce231a7
72fffb0
7733cbc
b975463
0a3fcc9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,16 +190,14 @@ client_rpc_xact_1(char *argp, CLIENT *clnt) | |
| */ | ||
| /* ARGSUSED */ | ||
| char * | ||
| rpc_xact_1(msg, transp) | ||
| char *msg; | ||
| register SVCXPRT *transp; | ||
| rpc_xact_1(char *msg, register SVCXPRT *transp) | ||
| { | ||
| static char r = 123; | ||
|
|
||
| return &r; | ||
| } | ||
|
|
||
| static void xact_prog_1(); | ||
| static void xact_prog_1(struct svc_req *rqstp, register SVCXPRT *transp); | ||
|
|
||
| void | ||
| server_main() | ||
|
|
@@ -237,16 +235,14 @@ server_main() | |
| } | ||
|
|
||
| static void | ||
| xact_prog_1(rqstp, transp) | ||
| struct svc_req *rqstp; | ||
| register SVCXPRT *transp; | ||
| xact_prog_1(struct svc_req *rqstp, register SVCXPRT *transp) | ||
| { | ||
| union { | ||
| char rpc_xact_1_arg; | ||
| } argument; | ||
| char *result; | ||
| bool_t (*xdr_argument)(), (*xdr_result)(); | ||
| char *(*local)(); | ||
| bool_t (*xdr_argument)(XDR *, char *), (*xdr_result)(XDR *, char *); | ||
| char *(*local)(char *, struct svc_req *); | ||
|
|
||
| switch (rqstp->rq_proc) { | ||
| case NULLPROC: | ||
|
|
@@ -256,7 +252,7 @@ xact_prog_1(rqstp, transp) | |
| case RPC_XACT: | ||
| xdr_argument = xdr_char; | ||
| xdr_result = xdr_char; | ||
| local = (char *(*)()) rpc_xact_1; | ||
| local = (char *(*)(char *, struct svc_req *)) rpc_xact_1; | ||
| break; | ||
|
|
||
| case RPC_EXIT: | ||
|
|
@@ -273,7 +269,7 @@ xact_prog_1(rqstp, transp) | |
| svcerr_decode(transp); | ||
| return; | ||
| } | ||
| result = (*local)(&argument, rqstp); | ||
| result = (*local)((char *)&argument, rqstp); | ||
| if (result != NULL && !svc_sendreply(transp, (xdrproc_t)xdr_result, result)) { | ||
|
Comment on lines
+272
to
273
|
||
| svcerr_systemerr(transp); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,7 +19,7 @@ char *id = "$Id$\n"; | |||||||
|
|
||||||||
| void client_main(int ac, char **av); | ||||||||
| void server_main(); | ||||||||
| void timeout(); | ||||||||
| void timeout(int signum); | ||||||||
| void init(iter_t iterations, void* cookie); | ||||||||
| void cleanup(iter_t iterations, void* cookie); | ||||||||
| void doit(iter_t iterations, void* cookie); | ||||||||
|
|
@@ -164,7 +164,7 @@ cleanup(iter_t iterations, void* cookie) | |||||||
| } | ||||||||
|
|
||||||||
| void | ||||||||
| timeout() | ||||||||
| timeout(int signum) | ||||||||
| { | ||||||||
|
||||||||
| { | |
| { | |
| (void)signum; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@charlie-rivos: This code was written by you, what do you think?
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ void | |
| initialize(iter_t iterations, void* cookie) | ||
| { | ||
| struct _state* pState = (struct _state*)cookie; | ||
| void exit(); | ||
| void exit(int); | ||
|
|
||
|
Comment on lines
73
to
75
|
||
| if (iterations) return; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -84,7 +84,7 @@ int norepeats = -1; | |||||||
| bds_msg *m1, *m2; | ||||||||
| #endif | ||||||||
|
|
||||||||
| uint64 getarg(); | ||||||||
| uint64 getarg(char *s, int ac, char **av); | ||||||||
| int been_there(uint64 off); | ||||||||
| int getfile(char *s, int ac, char **av); | ||||||||
|
|
||||||||
|
|
@@ -156,7 +156,7 @@ char *cmds[] = { | |||||||
|
|
||||||||
|
|
||||||||
| void error(char *); | ||||||||
| void done(); | ||||||||
| void done(int signum); | ||||||||
| #ifdef DBG | ||||||||
| extern int dbg; | ||||||||
| #endif | ||||||||
|
|
@@ -170,7 +170,7 @@ main(int ac, char **av) | |||||||
| int Fork, misses, mismatch, outpat, inpat, in, timeopen, gotcnt; | ||||||||
| int slp; | ||||||||
| uint64 skip, size, count; | ||||||||
| void chkarg(); | ||||||||
| void chkarg(char *arg); | ||||||||
| int i; | ||||||||
| uint64 off = 0; | ||||||||
| int touch; | ||||||||
|
|
@@ -340,7 +340,7 @@ main(int ac, char **av) | |||||||
| register int moved; | ||||||||
|
|
||||||||
| if (gotcnt && count-- <= 0) { | ||||||||
| done(); | ||||||||
| done(0); | ||||||||
| } | ||||||||
|
|
||||||||
| /* | ||||||||
|
|
@@ -453,7 +453,7 @@ main(int ac, char **av) | |||||||
| perror("read"); | ||||||||
| } | ||||||||
| if (moved <= 0) { | ||||||||
| done(); | ||||||||
| done(0); | ||||||||
| } | ||||||||
| if (inpat != -1) { | ||||||||
| register int foo, cnt; | ||||||||
|
|
@@ -466,7 +466,7 @@ main(int ac, char **av) | |||||||
| (uint)(off + foo*sizeof(int)), | ||||||||
| buf[foo]); | ||||||||
| if (mismatch != -1 && --misses == 0) { | ||||||||
| done(); | ||||||||
| done(0); | ||||||||
| } | ||||||||
| } | ||||||||
| } | ||||||||
|
|
@@ -531,7 +531,7 @@ main(int ac, char **av) | |||||||
| if (moved2 != moved) { | ||||||||
| fprintf(stderr, "write: wanted=%d got=%d\n", | ||||||||
| moved, moved2); | ||||||||
| done(); | ||||||||
| done(0); | ||||||||
| } | ||||||||
| if ((Wtmax != -1) || (Wtmin != -1)) { | ||||||||
| int mics = stop(&start_tv, &stop_tv); | ||||||||
|
|
@@ -568,7 +568,7 @@ main(int ac, char **av) | |||||||
| perror("write"); | ||||||||
| } | ||||||||
| if (moved2 != moved) { | ||||||||
| done(); | ||||||||
| done(0); | ||||||||
| } | ||||||||
|
|
||||||||
| if (touch) { | ||||||||
|
|
@@ -634,7 +634,7 @@ chkarg(char *arg) | |||||||
| } | ||||||||
|
|
||||||||
| void | ||||||||
| done(void) | ||||||||
| done(int signum) | ||||||||
| { | ||||||||
|
||||||||
| { | |
| { | |
| (void)signum; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@charlie-rivos: This code was written by you, what do you think?
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -26,7 +26,7 @@ char *buf; | |||||||
| char *bufs[3]; | ||||||||
| int Dflg, dflg, nflg, lflg, fflg, zflg; | ||||||||
| int data, logfile; | ||||||||
| void die(); | ||||||||
| void die(int signum); | ||||||||
| void worker(); | ||||||||
| char *http_time(void); | ||||||||
| char *date(time_t *tt); | ||||||||
|
|
@@ -387,7 +387,7 @@ logit(int sock, char *name, int size) | |||||||
| nbytes += len; | ||||||||
| } | ||||||||
|
|
||||||||
| void die() | ||||||||
| void die(int signum) | ||||||||
| { | ||||||||
|
||||||||
| { | |
| { | |
| (void)signum; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@charlie-rivos: This code was written by you, what do you think?
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -151,7 +151,7 @@ test_malloc(size_t size) | |
| } | ||
|
|
||
| void | ||
| gotalarm() | ||
| gotalarm(int) | ||
| { | ||
| alarm_triggered = 1; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rpc_xact_1is declared/defined aschar *rpc_xact_1(char *msg, SVCXPRT *transp), butlocalis typed as taking(char *, struct svc_req *). This forces an incompatible function-pointer cast later and makes the subsequent indirect call undefined behavior. Make thelocalfunction pointer type and call site match the actual server procedure signature (either changelocalto takeSVCXPRT *and passtransp, or changerpc_xact_1to takestruct svc_req *and update its prototype accordingly).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@charlie-rivos: This code was written by you, what do you think?