Well, the implementations I have checked (Solaris, FreeBSD, and Linux) all
work so that compiling the modified source WITHOUT -D DEFNAME is equivalent
to compiling the original. That is, the additions (and subtractions) are
marked by #ifdef DEFNAME (or #ifndef DEFNAME).
This also seems to me to be the intuitive answer. I would vote in favor of
requiring this unless someone can show substantial existing practice the
other way. If that is the case, I'd accept unspecified or (better)
implementation defined. However, I would certainly vote AGAINST a
requirement that make compiling the modified source WITH -D DEFNAME
equivalent to compiling the original.
--
Nick
----- Original Message -----
From: Geoff Clare <yyy@xxxxxxxxxxxxx>
To: <yyyyyyyyyyyyyyy@xxxxxxxxxxxxx>
Sent: Friday, June 07, 2002 8:10 AM
Subject: Defect in XCU patch
> @ page 688 line 26482 section patch comment [gwc patch ifdef]
>
> Problem:
>
> Defect code : 3. Clarification required
>
> The description of the patch -D option does not indicate which way
> round the ifdef selection should be. Given the file source.c and
> a patch to be applied to it, when patch is used as follows:
>
> patch -D DEFNAME source.c < patchfile
>
> is compiling the modified source.c *with* -D DEFNAME equivalent to
> compiling the original version of source.c, or is compiling the
> modified source.c *without* -D DEFNAME equivalent to compiling the
> original version of source.c?
>
> There are existing implementations of patch which differ in this
> respect.
>
> Action:
>
> The options would seem to be ...
>
> a. State that the behaviour is unspecified, and add a note under
> APPLICATION USAGE to warn application writers about it.
>
> b. Require that the ifdef selection is one way round or the other.
> Which way round would depend on historical behaviour and how many
> existing implementations do it each way.
>
|