This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: (patch) hpjyg21: FAT_FREE_PSYMTABS
- To: Stan Shebs <shebs at cygnus dot com>
- Subject: Re: (patch) hpjyg21: FAT_FREE_PSYMTABS
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Fri, 12 Nov 1999 11:06:37 +1100
- CC: cagney at cygnus dot com, gdb-patches at sourceware dot cygnus dot com, guo at cup dot hp dot com
- Organization: Cygnus Solutions
- References: <199911112341.PAA29252@andros.cygnus.com>
Stan Shebs wrote:
>
> Date: Fri, 12 Nov 1999 10:10:14 +1100
> From: Andrew Cagney <ac131313@cygnus.com>
>
> I've another meta maintainer question on this :-)
>
> Is it better to use #ifdef or have the compiler eliminate optional
> code? For instance:
>
> if (FAT_FREE_PSYMTABS)
> {
> }
>
> I favor this over ifdefs. Not only does it facilitate maintenance,
> but it leaves open options for cross-debugging and for making
> decisions at runtime. The only reasonable exception would be provably
> time-critical code where ifdefs would allow compiler optimizations not
> available if the code were merely "if (0)". (There might be examples
> of this in the stabs reader, although I don't know of any myself.)
``Trust me'', there are no cases where this can occure :-)
Compiling with -O eliminates all of them (well it does for GCC, if other
compilers can't eliminate that then they are broken :-).
Andrew