This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

Re: (patch) hpjyg21: FAT_FREE_PSYMTABS


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

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