From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <3ad045e675c92ccadaa4dcb0e5f36a38@quintile.net> References: <3ad045e675c92ccadaa4dcb0e5f36a38@quintile.net> Date: Sat, 3 Sep 2011 08:17:22 -0400 Message-ID: From: Comeau At9Fans To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001636c5bd41c2f34404ac0875d0 Subject: Re: [9fans] c code differencing Topicbox-Message-UUID: 188a230a-ead7-11e9-9d60-3106f5b1d025 --001636c5bd41c2f34404ac0875d0 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Aug 31, 2011 at 9:01 AM, Steve Simon wrote: > Anyone have any pointers to a diff for C code. > > I have two libraries, A and B. > > B is and expanded and modified version of A and I have been > asked to extract A from B to build two libraries one > built on top of the other. > I'm unclear what you're seeking. For instance, given this: // original/a.c // ...mumbly... void foo() { int i; i = x(); i = y() } and // new/a.c // ...mumbly... void foo() { int i; i = y(); i = z(); } the obvious line of difference is the removal of i = x() and the addition of i = z(); So what will the diff'd version look like, conceptually would it be this? : // diffd/a.c // ...mumbly... // ...possible more mumbly... void foo() { int i; diffd_old(); i = y(); diffd_new(); } -- Greg Comeau / 4.3.10.1 with C++0xisms now in beta! Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried it? --001636c5bd41c2f34404ac0875d0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Aug 31, 2011 at 9:01 AM, Steve Simon <steve@quintile.net> wrote:
=
Anyone have any pointers to a diff for C code.

I have two libraries, A and B.

B is and expanded and modified version of A and I have been
asked to extract A from B to build two libraries one
built on top of the other.

I'm uncl= ear what you're seeking. =A0For instance, given this:

// original/a.c
// ...mumbly...
void foo()
{
=A0 =A0 int i;

=A0 =A0 i =3D x();=
=A0 =A0 i =3D y()
}

and
=

// new/a.c
// ...mumbly...
voi= d foo()
{
=A0 =A0 int i;

=A0 =A0 i =3D y();=
=A0 =A0 i =3D z();
}

<= div>the obvious line of difference is the removal of i =3D x() and the addi= tion of i =3D z(); =A0So what will the diff'd version look like, concep= tually would it be this? :

// diffd/a.c
// ...mumbly...
// ...= possible more mumbly...
void foo()
{
=A0 =A0 = int i;

=A0 =A0 diffd_old();
=A0 =A0 i = =3D y();
=A0 =A0 diffd_new();
}=A0

--
Gr= eg Comeau / 4.3.10.1 with C++0xisms now in beta!
Comeau C/C++ ONL= INE =3D=3D> =A0 =A0 http://www.comeaucomputing.com/tryitout
World Class Compilers: =A0Breathtaking C++, Amazing C99, Fabulous C90.=
Comeau C/C++ with Dinkumware's Libraries... Have you tried i= t?

--001636c5bd41c2f34404ac0875d0--