This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: Fix for PR 2369
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: tromey at redhat dot com
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 26 Nov 2001 13:23:43 +1300
- Subject: Re: Patch: Fix for PR 2369
- References: <87r8qm8vaj.fsf@creche.redhat.com>
Tom Tromey wrote:
>This fixes PR 2369. It adds some up-front checking to --main, so that
>gcj will give an error if the argument isn't a valid name.
>
>This patch is a bit hacky. It duplicates some code from lex.h. The
>alternative would require introducing a new file; I'm willing to
>rewrite this way if required.
>
If we passed the --main option through to jc1, it could verify that it
is not only a valid class name but also an actual class that contains a
"main" method. Since jc1 is always run before the linker, it could give
an intelligent error message if --main wasn't valid. This wouldn't help
when just using "gcj" for linking, though. It would also be nice if gcj
would automatically find a "main" when no --main option is given.
So, maybe the ultimate fix would be to get rid of the jvgenmain stuff,
and have jc1 generate the C "main" itself. The driver would pass
"-fmain" if a main method is required but was not specified, or
-fmain=xxx if the user specified one.
regards
Bryce.