This is the mail archive of the java-discuss@sourceware.cygnus.com 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 -D


>>>>> "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

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