This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Cleanup #if 0
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ondrej Bilka <neleai at seznam dot cz>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Liubov Dmitrieva <liubov dot dmitrieva at gmail dot com>, Carlos O'Donell <carlos at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 1 Jul 2013 21:44:55 +0000
- Subject: Re: Cleanup #if 0
- References: <CAHjhQ93YUtMz14Aj7JfhJ7Tq++eC+23cA6yubh1KPRpKTvvkaw at mail dot gmail dot com> <51D0967A dot 7050102 at redhat dot com> <CAHjhQ92mTi8OmY7RBC3=sCaX=-xbgGH82pCBz4fCQkBLJcNqOA at mail dot gmail dot com> <CAMe9rOr8o7OnB0T0tG50J7oXmJJF_XOiUDLK6Gsc1tMu-NOFrQ at mail dot gmail dot com> <CAHjhQ90Hrj78WYJ_sQ2Eu7mzf63Wbnuihcv88KBMdxJo5q1Yxg at mail dot gmail dot com> <CAMe9rOojGtDZcb6Phk3a1sp+B3XhQwRJo9ZjovC==1OG2_8k=g at mail dot gmail dot com> <CAMe9rOro+9nJ2cXHfa4xa9TPZRfn_zt19waHc_80GLRWaC4K+g at mail dot gmail dot com> <20130701203146 dot GA9033 at popelka dot ms dot mff dot cuni dot cz>
On Mon, 1 Jul 2013, Ondrej Bilka wrote:
> As this caused problems it would be good idea to globaly remove code
> surrounded by
> #if 0
> It is easy to automate, question is how many parts can be used and what
> are bitrotten.
Typically any cleanup of such code needs to replace it by a comment
explaining the reason the code does not do whatever the #if 0 code did, if
someone might still think that was a reasonable thing to do (and in some
such cases, the #if 0 code may make sense to keep to accompany and clarify
the comment). That is, automation isn't useful beyond locating where #if
0 code is present in the source tree; every case needs individual manual
consideration involving understanding why the #if 0 code and conditionals
are there in the first place.
(Other #if cleanups may still be useful. For example, cleaning up
conditionals on __GNUC__ or on the GCC version being sufficiently recent
when 4.4 is recent enough so the conditional never does anything now - but
such cleanups can't be done in installed headers, or in filed shared by
gnulib, so you stll need to examine each case individually to see if
either of those issues applies.)
--
Joseph S. Myers
joseph@codesourcery.com