The fix is to cast &flag to (char *) [I tried (void *), but the C++ rules don't allow that].
Later, same target-arch:
../../../src/ioc/rsrv/caservertask.c: In function `tryBind':
../../../src/ioc/rsrv/caservertask.c:135: warning: passing arg 2 of `bind' from incompatible pointer type
../../../src/ioc/rsrv/caservertask.c: In function `rsrv_grap_tcp':
../../../src/ioc/rsrv/caservertask.c:201: parse error before `alen'
../../../src/ioc/rsrv/caservertask.c:202: `alen' undeclared (first use in this function)
../../../src/ioc/rsrv/caservertask.c:202: (Each undeclared identifier is reported only once
../../../src/ioc/rsrv/caservertask.c:202: for each function it appears in.)
../../../src/ioc/rsrv/caservertask.c: In function `rsrv_init':
../../../src/ioc/rsrv/caservertask.c:579: warning: passing arg 4 of `setsockopt' from incompatible pointer type
On line 135 change bind() arg #2 to be (struct sockaddr *) &addr->sa (cast is needed to drop const).
Line 201 is not standard C code, a declaration appears after other statements in block; swapped with preceding line.
Line 579 needs another cast to (char *).
The result builds on all my standard architectures.
Question: Is 'rsrv_grap_tcp' a typo for 'rsrv_grab_tcp'?
Could your point about there being a broadcast route through lo conceivably apply to other OSs too? If so I would prefer that we use some other conditional in the libCom/osi/os/default/osdNetInf.c file to enable that code; adding a port to a new OS should be possible without having to make *any* changes to the existing code. I would define some macro in osi/os/Linux/osdSock.h and use that instead of __linux__ in osdNetInf.c.
More to come, I'll try to do some testing this afternoon.
When building for VxWorks 5.5.2 (which we still support):
../udpiiu.cpp: In method `udpiiu: :udpiiu( epicsGuard< epicsMutex> &, epicsTimerQueue Active &, epicsMutex &, epicsMutex &, cacContextNotify &, cac &, unsigned int, tsDLList< SearchDest> &)':
../udpiiu.cpp:169: passing `int *' as argument 4 of `setsockopt(int, int, int, char *, int)'
The fix is to cast &flag to (char *) [I tried (void *), but the C++ rules don't allow that].
Later, same target-arch:
../../. ./src/ioc/ rsrv/caserverta sk.c: In function `tryBind': ./src/ioc/ rsrv/caserverta sk.c:135: warning: passing arg 2 of `bind' from incompatible pointer type ./src/ioc/ rsrv/caserverta sk.c: In function `rsrv_grap_tcp': ./src/ioc/ rsrv/caserverta sk.c:201: parse error before `alen' ./src/ioc/ rsrv/caserverta sk.c:202: `alen' undeclared (first use in this function) ./src/ioc/ rsrv/caserverta sk.c:202: (Each undeclared identifier is reported only once ./src/ioc/ rsrv/caserverta sk.c:202: for each function it appears in.) ./src/ioc/ rsrv/caserverta sk.c: In function `rsrv_init': ./src/ioc/ rsrv/caserverta sk.c:579: warning: passing arg 4 of `setsockopt' from incompatible pointer type
../../.
../../.
../../.
../../.
../../.
../../.
../../.
../../.
On line 135 change bind() arg #2 to be (struct sockaddr *) &addr->sa (cast is needed to drop const).
Line 201 is not standard C code, a declaration appears after other statements in block; swapped with preceding line.
Line 579 needs another cast to (char *).
The result builds on all my standard architectures.
Question: Is 'rsrv_grap_tcp' a typo for 'rsrv_grab_tcp'?
Could your point about there being a broadcast route through lo conceivably apply to other OSs too? If so I would prefer that we use some other conditional in the libCom/ osi/os/ default/ osdNetInf. c file to enable that code; adding a port to a new OS should be possible without having to make *any* changes to the existing code. I would define some macro in osi/os/ Linux/osdSock. h and use that instead of __linux__ in osdNetInf.c.
More to come, I'll try to do some testing this afternoon.