9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Comeau At9Fans <comeauat9fans@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] c code differencing
Date: Sat,  3 Sep 2011 08:17:22 -0400	[thread overview]
Message-ID: <CAE9W7-gt47DfBWUmhAg0iAzL7X76RfOYCMqutzmi+wFkZ9haYw@mail.gmail.com> (raw)
In-Reply-To: <3ad045e675c92ccadaa4dcb0e5f36a38@quintile.net>

[-- Attachment #1: Type: text/plain, Size: 1149 bytes --]

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 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?

[-- Attachment #2: Type: text/html, Size: 1923 bytes --]

      parent reply	other threads:[~2011-09-03 12:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-31 13:01 Steve Simon
2011-08-31 14:01 ` Rodolfo kix Garcia
2011-09-01 13:16 ` Ethan Grammatikidis
2011-09-01 14:33 ` FENG Yu Ning
2011-09-01 14:51 ` Anthony Sorace
2011-09-01 14:59   ` Anthony Sorace
2011-09-03 12:17 ` Comeau At9Fans [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE9W7-gt47DfBWUmhAg0iAzL7X76RfOYCMqutzmi+wFkZ9haYw@mail.gmail.com \
    --to=comeauat9fans@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).