public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH, libjava: silence more warnings
@ 2009-12-01 18:22 Ben Elliston
  2009-12-01 18:32 ` Dave Korn
  2009-12-01 18:49 ` Andrew Haley
  0 siblings, 2 replies; 5+ messages in thread
From: Ben Elliston @ 2009-12-01 18:22 UTC (permalink / raw)
  To: java, gcc-patches; +Cc: Andrew Haley

This patch silences a couple of more warnings in libjava:

  libjava/java/net/natVMURLConnection.cc:64:1: warning: unused parameter ‘bytes’
  libjava/java/net/natVMURLConnection.cc:64:1: warning: unused parameter ‘valid’

Tested with a bootstrap on x86_64-linux.  Okay for the trunk?

Ben


2009-12-02  Ben Elliston  <bje@au.ibm.com>

        * java/net/natVMURLConnection.cc (guessContentTypeFromBuffer):
        Mark `bytes' and `valid' parameters as potentially unused.

Index: java/net/natVMURLConnection.cc
===================================================================
--- java/net/natVMURLConnection.cc      (revision 154873)
+++ java/net/natVMURLConnection.cc      (working copy)
@@ -61,8 +61,8 @@
 }
 
 ::java::lang::String *
-java::net::VMURLConnection::guessContentTypeFromBuffer (jbyteArray bytes,
-                                                       jint valid)
+java::net::VMURLConnection::guessContentTypeFromBuffer (jbyteArray bytes __attribute__ ((unused)),
+                                                       jint valid __attribute__ ((unused)))
 {
 #if defined (HAVE_MAGIC_T) && defined (HAVE_MAGIC_H) && defined (USE_LTDL)
   const char *result;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH, libjava: silence more warnings
  2009-12-01 18:22 PATCH, libjava: silence more warnings Ben Elliston
@ 2009-12-01 18:32 ` Dave Korn
  2009-12-01 19:44   ` Tom Tromey
  2009-12-01 18:49 ` Andrew Haley
  1 sibling, 1 reply; 5+ messages in thread
From: Dave Korn @ 2009-12-01 18:32 UTC (permalink / raw)
  To: Ben Elliston; +Cc: java, gcc-patches, Andrew Haley

Ben Elliston wrote:

>  ::java::lang::String *
> -java::net::VMURLConnection::guessContentTypeFromBuffer (jbyteArray bytes,
> -                                                       jint valid)
> +java::net::VMURLConnection::guessContentTypeFromBuffer (jbyteArray bytes __attribute__ ((unused)),
> +                                                       jint valid __attribute__ ((unused)))

  There's a #define MAYBE_UNUSED in include/jvm.h, as used in
java/lang/natClass.cc.  But maybe jvm.h isn't available here?

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH, libjava: silence more warnings
  2009-12-01 18:22 PATCH, libjava: silence more warnings Ben Elliston
  2009-12-01 18:32 ` Dave Korn
@ 2009-12-01 18:49 ` Andrew Haley
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Haley @ 2009-12-01 18:49 UTC (permalink / raw)
  To: Ben Elliston; +Cc: java, gcc-patches

Ben Elliston wrote:
> This patch silences a couple of more warnings in libjava:
> 
>   libjava/java/net/natVMURLConnection.cc:64:1: warning: unused parameter ‘bytes’
>   libjava/java/net/natVMURLConnection.cc:64:1: warning: unused parameter ‘valid’
> 
> Tested with a bootstrap on x86_64-linux.  Okay for the trunk?

OK.

Andrew.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH, libjava: silence more warnings
  2009-12-01 18:32 ` Dave Korn
@ 2009-12-01 19:44   ` Tom Tromey
  2009-12-01 20:15     ` Dave Korn
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2009-12-01 19:44 UTC (permalink / raw)
  To: Dave Korn; +Cc: Ben Elliston, java, gcc-patches, Andrew Haley

>>>>> "Dave" == Dave Korn <dave.korn.cygwin@googlemail.com> writes:

Dave> Ben Elliston wrote:
>> ::java::lang::String *
>> -java::net::VMURLConnection::guessContentTypeFromBuffer (jbyteArray bytes,
>> -                                                       jint valid)
>> +java::net::VMURLConnection::guessContentTypeFromBuffer (jbyteArray bytes __attribute__ ((unused)),
>> +                                                       jint valid __attribute__ ((unused)))

Dave>   There's a #define MAYBE_UNUSED in include/jvm.h, as used in
Dave> java/lang/natClass.cc.  But maybe jvm.h isn't available here?

It is ok to include jvm.h from any of the CNI code.

But, it is also ok to just use an unadorned __attribute__.  We know this
code can only be compiled by g++.

Tom

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH, libjava: silence more warnings
  2009-12-01 19:44   ` Tom Tromey
@ 2009-12-01 20:15     ` Dave Korn
  0 siblings, 0 replies; 5+ messages in thread
From: Dave Korn @ 2009-12-01 20:15 UTC (permalink / raw)
  To: tromey; +Cc: Dave Korn, Ben Elliston, java, gcc-patches, Andrew Haley

Tom Tromey wrote:
>>>>>> "Dave" == Dave Korn <dave.korn.cygwin@googlemail.com> writes:
> 
> Dave> Ben Elliston wrote:
>>> ::java::lang::String *
>>> -java::net::VMURLConnection::guessContentTypeFromBuffer (jbyteArray bytes,
>>> -                                                       jint valid)
>>> +java::net::VMURLConnection::guessContentTypeFromBuffer (jbyteArray bytes __attribute__ ((unused)),
>>> +                                                       jint valid __attribute__ ((unused)))
> 
> Dave>   There's a #define MAYBE_UNUSED in include/jvm.h, as used in
> Dave> java/lang/natClass.cc.  But maybe jvm.h isn't available here?
> 
> It is ok to include jvm.h from any of the CNI code.
> 
> But, it is also ok to just use an unadorned __attribute__.  We know this
> code can only be compiled by g++.

  ... given which, it's hardly worth adding a new header dependency just to
get the macro.  Right, thanks for clarifying that.

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-12-01 20:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-01 18:22 PATCH, libjava: silence more warnings Ben Elliston
2009-12-01 18:32 ` Dave Korn
2009-12-01 19:44   ` Tom Tromey
2009-12-01 20:15     ` Dave Korn
2009-12-01 18:49 ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).