This is the mail archive of the java@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]

RE: gcj flags


Good point.  I suspect they should use gcj for linking.  That argues the
ideal rule should be:

If the only file arguments are .java and .class files, and there is no
--main:
  1) If there is exactly one file argument, generate the --main
  2) If there is more than one, issue a warning, suggesting --main.  (This
gets a little tricky if there are nonstandard libraries involved, which
might be hiding main.  If none are explicitly listed, a warning should
certainly be safe.)

It may just be me, but I also fairly regularly found myself mistyping:

gcj --main==X X.java

which results in a fairly uninformative error message.  If other people have
done this too, it would be nice to have --main do a little bit of checking
on the associated name.

I would guess that by far the most important of all of these is to make sure
that a simple

gcj X.java

does something plausible, since that's the first thing most most people will
try.

Hans

> -----Original Message-----
> From: Per Bothner [mailto:per@bothner.com]
> Sent: Thursday, March 22, 2001 2:04 PM
> To: Boehm, Hans
> Cc: java@gcc.gnu.org
> Subject: Re: gcj flags
> 
> 
> "Boehm, Hans" <hans_boehm@hp.com> writes:
> 
> > 2) Is there a reason that --main is not implied if the 
> linker is invoked to
> > generate an executable, and there is a single filename 
> argument?  As far as
> > I can tell, that's a pretty natural thing to type (I still 
> do it regularly).
> > In the case of more than one file can't it just say 
> "missing --main flag"?
> > I still forget the --main regularly when I'm running small 
> tests.  And the
> > current semantics of "fail in the linker" never seem to be 
> what I meant :-)
> 
> I guess we need to decide what to do about applications that have a
> C/C++ main, and use the (future) invocation interface to 
> start up Java.
> Should they use the gcj or the g++ command?
> -- 
> 	--Per Bothner
> per@bothner.com   http://www.bothner.com/~per/
> 


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