This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Eliminate natSocketChannelImpl.cc warnings


Howdy,

natSocketChannelImpl.cc generates the following warnings

 ../../../../gcc/libjava/gnu/java/nio/natSocketChannelImpl.cc: In static member 
    function `static jint 
    gnu::java::nio::SocketChannelImpl::SocketConnect(__java_int, 
    java::net::InetAddress*, __java_int)':
 ../../../../gcc/libjava/gnu/java/nio/natSocketChannelImpl.cc:96: warning: unused
    parameter `jint fd'
 ../../../../gcc/libjava/gnu/java/nio/natSocketChannelImpl.cc:96: warning: unused
    parameter `java::net::InetAddress*addr'
 ../../../../gcc/libjava/gnu/java/nio/natSocketChannelImpl.cc:96: warning: unused
    parameter `jint port'
 ../../../../gcc/libjava/gnu/java/nio/natSocketChannelImpl.cc: In static member 
    function `static jint 
    gnu::java::nio::SocketChannelImpl::SocketBind(__java_int, 
    java::net::InetAddress*, __java_int)':
 ../../../../gcc/libjava/gnu/java/nio/natSocketChannelImpl.cc:104: warning: unused
    parameter `jint fd'
 ../../../../gcc/libjava/gnu/java/nio/natSocketChannelImpl.cc:104: warning: unused
    parameter `java::net::InetAddress*addr'
 ../../../../gcc/libjava/gnu/java/nio/natSocketChannelImpl.cc:104: warning: unused
    parameter `jint port'

Both functions are stubs that ignore their arguments, so the
following patch marks the parameters with

 __attribute__ ((__unused__))

Bootstrapped and regression tested on powerpc-unknown-linux-gnu,
and I checked that the warnings were eliminated.

I can commit to the GCC repository but not to the Classpath
repository.

OK to commit?

-- 
Matt Kraai          kraai@alumni.cmu.edu          Debian GNU/Linux

	* gnu/java/nio/natSocketChannelImpl.cc
	(gnu::java::nio::SocketChannelImpl::SocketConnect)
	(gnu::java::nio::SocketChannelImpl::SocketBind): Mark
	parameters with __attribute__ ((__unused__)).

Index: libjava/gnu/java/nio/natSocketChannelImpl.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/nio/natSocketChannelImpl.cc,v
retrieving revision 1.4
diff -3 -c -p -r1.4 natSocketChannelImpl.cc
*** libjava/gnu/java/nio/natSocketChannelImpl.cc	21 Feb 2003 08:19:34 -0000	1.4
--- libjava/gnu/java/nio/natSocketChannelImpl.cc	17 Jun 2003 08:06:15 -0000
*************** gnu::java::nio::SocketChannelImpl::Socke
*** 90,106 ****
  }
  
  jint
! gnu::java::nio::SocketChannelImpl::SocketConnect (jint fd,
!                                                   ::java::net::InetAddress *addr,
!                                                   jint port)
  {
    throw new ::java::io::IOException (JvNewStringUTF ("SocketConnect not implemented"));
  }
  
  jint
! gnu::java::nio::SocketChannelImpl::SocketBind (jint fd,
!                                                ::java::net::InetAddress *addr,
!                                                jint port)
  {
    throw new ::java::io::IOException (JvNewStringUTF ("SocketBind not implemented"));
  }
--- 90,112 ----
  }
  
  jint
! gnu::java::nio::SocketChannelImpl::SocketConnect (jint fd
! 						  __attribute__ ((__unused__)),
!                                                   ::java::net::InetAddress *addr
! 						  __attribute__ ((__unused__)),
!                                                   jint port
! 						  __attribute__ ((__unused__)))
  {
    throw new ::java::io::IOException (JvNewStringUTF ("SocketConnect not implemented"));
  }
  
  jint
! gnu::java::nio::SocketChannelImpl::SocketBind (jint fd
! 					       __attribute__ ((__unused__)),
! 					       ::java::net::InetAddress *addr
! 					       __attribute__ ((__unused__)),
! 					       jint port
! 					       __attribute__ ((__unused__)))
  {
    throw new ::java::io::IOException (JvNewStringUTF ("SocketBind not implemented"));
  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]