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]

Re: Patch: Fix for PR 2369


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.





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