Hi Simon, > > * test-gethostname.c:24: warning: initialization from incompatible pointer > > type > > Similarly: > > - POSIX: int gethostname(char *, size_t); > > - OSF/1: int gethostname(char *, int); > > > > Likewise. > > > > * test-inet_ntop.c:24: warning: initialization from incompatible pointer > > type > > Similarly: > > - POSIX: const char *inet_ntop(int, const void *, char *, socklen_t); > > - OSF/1: const char *inet_ntop(int, const void *, char *, size_t); > > > > Likewise. > > Couldn't this lead to crashes on 64-bit systems? Or aren't there any > 64-bit OSF/1 systems? I'm not familiar with OSF/1.
OSF/1 systems all have the DEC Alpha CPU, a 64-bit processor. On this processor, all integer registers are 64 bits wide, and the first 6 arguments are passed in integer registers (see gcc-4.5.2/gcc/config/alpha/alpha.h the definition of FUNCTION_ARG_REGNO_P). Therefore for a value between 0 and 2^32-1 it does not matter whether it is passed as 'unsigned int' (32 bits, zero-extended) or 'unsigned long' (64 bits). Regarding the zero-extend, I believe gcc nowadays handles this correctly (GCC 2.x had bugs in this area). In summary, passing 'int' / 'socklen_t' / 'size_t' by value is not critical on Alpha. Only passing such an argument or return value through a pointer may require a wrapper function. Bruno