This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
re: gcj -D
- To: Mike Moreton <mike at pillim dot demon dot co dot uk>
- Subject: re: gcj -D
- From: Tom Tromey <tromey at cygnus dot com>
- Date: Mon, 18 Oct 1999 10:00:14 -0700
- Cc: java-discuss at sourceware dot cygnus dot com
- References: <199910181448.PAA00792@pillim>
>>>>> "Mike" == Mike Moreton <mike@pillim.demon.co.uk> writes:
Mike> I believe that if Java is to become a general purpose
Mike> programming language, it's going to need a pre-processor, and
Mike> I'd prefer it to be a standard one, rather than each project
Mike> inventing their own.
Mike> If this is the case, the -D option is going to be needed for
Mike> defining pre-processor symbols (as it is with C and C++). It
Mike> sounds like using it for something that is essentially
Mike> different, is one of those things that will come back to haunt
Mike> you in later years.
That might be true, but it is just speculation. I personally doubt
Java will ever have a preprocessor.
Still, I'm not completely wedded to using "-D". Does anybody else
care (either way)? Does anybody have a good suggestion for a
replacement? I chose "-D" because it seemed intuitive. It does at
compile time what "-D" does for "java" at runtime.
Mike> The normal technique used in C, is to use the CPP to cut out all
Mike> the debugging code in the runtime system, but leave it in for
Mike> the debug version. This has to be a compile time decision,
Mike> because deciding at run-time wastes perfromance in itself.
Another way to solve your problem is to have the linker omit code that
is not used. When you build the production version of your
application, you would link with a special flag to do this. The GNU
binutils have support for this, but gcj doesn't take advantage of it
yet.
Tom