Next stop: net-dev.

-------- Alkuperäinen viesti / Orig.Msg. --------
Aihe: Re: Fixing compiler warnings
Päiväys: Thu, 24 May 2007 18:55:39 +0100
Lähettäjä: Alan Bateman <[EMAIL PROTECTED]>
Vastaanottaja: Petteri Räty <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Viittaukset: <[EMAIL PROTECTED]>

Petteri Räty wrote:
> This silences some QA warnings given by GCC. I don't have access to
> Solaris so it would probably be safest to test there before committing
> although man gettimeofday is claiming that the function is quite standard:
>
> CONFORMING TO
>        SVr4, 4.3BSD.  POSIX.1-2001 describes gettimeofday() but not
> settimeofday().
>
> I haven't signed the SCA but this is hardly copyrightable.
>
> Regards,
> Petteri
> --
> Gentoo/Java project lead
>   
Petteri - the networking libraries is the net-dev@openjdk.java.net
mailing list so I would suggest posting the patch to that list.

-Alan.

Currently the building gives:
 * QA Notice: Package has poor programming practices which may compile
 *            fine but exhibit random runtime failures.
 * ../../../src/solaris/native/java/net/Inet4AddressImpl.c:381: warning: implicit declaration of function 'gettimeofday'
../../../src/solaris/native/java/net/Inet6AddressImpl.c:511: warning: implicit declaration of function 'gettimeofday'
 * ../../../src/solaris/native/java/net/Inet4AddressImpl.c:381: warning: implicit declaration of function 'gettimeofday'
../../../src/solaris/native/java/net/Inet6AddressImpl.c:511: warning: implicit declaration of function 'gettimeofday'
 * ../../../src/solaris/native/java/net/Inet4AddressImpl.c:381: warning: implicit declaration of function 'gettimeofday'
../../../src/solaris/native/java/net/Inet6AddressImpl.c:511: warning: implicit declaration of function 'gettimeofday'
 * ../../../src/solaris/native/java/net/Inet4AddressImpl.c:381: warning: implicit declaration of function 'gettimeofday'
../../../src/solaris/native/java/net/Inet6AddressImpl.c:511: warning: implicit declaration of function 'gettimeofday'

This fixes those warnings by including the needed header.

Index: j2se/src/solaris/native/java/net/Inet4AddressImpl.c
===================================================================
--- j2se/src/solaris/native/java/net/Inet4AddressImpl.c	(revision 235)
+++ j2se/src/solaris/native/java/net/Inet4AddressImpl.c	(working copy)
@@ -24,6 +24,7 @@
  */
 
 #include <errno.h>
+#include <sys/time.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in_systm.h>
Index: j2se/src/solaris/native/java/net/Inet6AddressImpl.c
===================================================================
--- j2se/src/solaris/native/java/net/Inet6AddressImpl.c	(revision 235)
+++ j2se/src/solaris/native/java/net/Inet6AddressImpl.c	(working copy)
@@ -24,6 +24,7 @@
  */
 
 #include <errno.h>
+#include <sys/time.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to