This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Fix typo (and bootstrap failure) in jump.c
- To: pfeifer at dbai dot tuwien dot ac dot at
- Subject: Re: PATCH: Fix typo (and bootstrap failure) in jump.c
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Sun, 07 Jan 2001 12:41:18 -0800
- Cc: gcc-patches at gcc dot gnu dot org, jh at suse dot cz
- Organization: CodeSourcery, LLC
- References: <Pine.GSO.4.21.0101071958070.10504-100000@nunki.dbai.tuwien.ac.at>
>>>>> "Gerald" == Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> writes:
Gerald> I'm afraid that the following patch did not receive
Gerald> suitable testing:
Gerald> In my opinion, we should try to exercise #ifdef-ed code
Gerald> before committing to avoid this kind of problem.
Note that (as mentioned before) the best way to avoid this kind of
thing is often to do:
if (HAS_FOO)
...
else
...
rather than:
#ifdef HAS_FOO
...
#else
...
#endif
Letting the compiler do the syntax checking is no substitute for full
testing -- but it does catch these kinds of typos.
IMO, we should always endeavor to use the former style, unless it
really doesn't work for one reason or another, or unless it entails
including large amounts of code that will never be executed, and that
the compiler will be unable to optimize away. (Even in that case, I'm
suspicious as to whether such things would really make a noticable
difference in the size of the result executable...)
In the case of REVERSIBLE_CC_MODE this would require a little effort,
in that it's a function-like macro. But, that's easily fixed: in
defaults.h add:
#ifdef REVERSIBLE_CC_MODE
#define HAS_REVERSIBLE_CC_MODE 1
#else
#define HAS_REVERSIBLE_CC_MODE 0
#endif
Does anyone object to making an effort to follow this style in the
future?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com