public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* gcj and '-Wall'?
@ 2000-04-01  0:00 ADAM Sulmicki
  2000-04-01  0:00 ` Tom Tromey
  2000-04-01  0:00 ` Bryce McKinlay
  0 siblings, 2 replies; 3+ messages in thread
From: ADAM Sulmicki @ 2000-04-01  0:00 UTC (permalink / raw)
  To: java-discuss

It seems that '-Wall' is not supported with gcj.
Is this correct? I was hoping to use gcj to let me
know about any unused variables, and any other possible
bugs..

For that matter, does anyone know any other java compiler which has -Wall
like feature? 

bash$ cat hello.c 
#include<stdio.h>
main () {
        char ch;
        printf("hello\n");
}
bash$ gcc -Wall hello.c 
hello.c:2: warning: return-type defaults to `int'
hello.c: In function `main':
hello.c:3: warning: unused variable `ch'
hello.c:5: warning: control reaches end of non-void function
bash$ cat HelloWorld.java 
public class HelloWorld {
        public static void main(String [] args) {
                char ch;
                System.out.println("Hello");
        }
}
bash$ gcj -Wall --main=HelloWorld HelloWorld.java 
bash$


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

* Re: gcj and '-Wall'?
  2000-04-01  0:00 gcj and '-Wall'? ADAM Sulmicki
@ 2000-04-01  0:00 ` Tom Tromey
  2000-04-01  0:00 ` Bryce McKinlay
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2000-04-01  0:00 UTC (permalink / raw)
  To: ADAM Sulmicki; +Cc: java-discuss

>>>>> "Adam" == ADAM Sulmicki <adam@cfar.umd.edu> writes:

Adam> It seems that '-Wall' is not supported with gcj.
Adam> Is this correct?

-Wall is supported.  It just doesn't do what you think.

Adam> I was hoping to use gcj to let me
Adam> know about any unused variables, and any other possible
Adam> bugs..

Use -Wunused.  This is apparently a general gcc option.  It works with
gcj (but, unfortunately, on your example it prints too much -- a
lurking gcj bug).

I agree that gcj should enable -Wunused when -Wall is given, because
that is similar to what the C compiler does.  I consider this a bug in
gcj.  I'll submit a patch.

Tom



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

* Re: gcj and '-Wall'?
  2000-04-01  0:00 gcj and '-Wall'? ADAM Sulmicki
  2000-04-01  0:00 ` Tom Tromey
@ 2000-04-01  0:00 ` Bryce McKinlay
  1 sibling, 0 replies; 3+ messages in thread
From: Bryce McKinlay @ 2000-04-01  0:00 UTC (permalink / raw)
  To: ADAM Sulmicki; +Cc: java-discuss

ADAM Sulmicki wrote:

> It seems that '-Wall' is not supported with gcj.
> Is this correct? I was hoping to use gcj to let me
> know about any unused variables, and any other possible
> bugs..
>
> For that matter, does anyone know any other java compiler which has -Wall
> like feature?

Jikes has a pedantic compilation option (jikes +P) that is a bit like -Wall,
but it doesn't seem to report unused local variables - at least in the
version I have. It can get quite pendantic about your coding style though :)

regards

  [ bryce ]



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

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-01  0:00 gcj and '-Wall'? ADAM Sulmicki
2000-04-01  0:00 ` Tom Tromey
2000-04-01  0:00 ` Bryce McKinlay

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).