solaris 2.6 compile error on omapip/mrtrace.c

Joost Mulders mail at j-mulders.demon.nl
Tue Feb 27 00:22:47 UTC 2001


Hi again,

When I was testing with the dlpi story I ran into a compile error 
for mrtrace.c on solaris 2.6.

> gcc -g   -I../../includes  -Wall -Wno-unused -Wno-implicit -Wno-comment  -Wno-uninitialized -Wno-char-subscripts -Wno-switch -Werror  -DSOLARIS_MAJOR=5 -DSOLARIS_MINOR=6  -c  mrtrace.c
> cc1: warnings being treated as errors
> mrtrace.c: In function `trace_mr_connect':
> mrtrace.c:344: warning: passing arg 2 of `connect' discards qualifiers from pointer target type
> *** Error code 1

2.6:/usr/include/sys/socket.h lists:
#ifndef _KERNEL
#ifdef  __STDC__
#ifdef  _XPG4_2
<snip>
extern int connect(int, const struct sockaddr *, size_t);
<snip>
#else
<snip>
extern int connect(int, struct sockaddr *, int);
<snip>
#endif  /* _XPG4_2 */

It uses the second prototype because _XPG4_2 is not defined. 


On solaris 8, the compile of mrtrace.c works fine. 
2.8:/usr/include/sys/socket.h lists:
#ifndef _KERNEL
#ifdef  __STDC__
<snip>
extern int connect(int, const struct sockaddr *, socklen_t);
#else   /* __STDC__ */
<snip>
extern int connect();
<snip>
#endif  /* __STDC__ */
#endif  /* _KERNEL */


Changing the prototype + definition of trace_mr_connect from
  int trace_mr_connect (int s, const struct sockaddr *, SOCKLEN_T);
to
  int trace_mr_connect (int s, struct sockaddr *, SOCKLEN_T);

compiles fine on both. Don't know what other systems think about this though.


Regards,

Joost


More information about the dhcp-hackers mailing list