Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!yale!cmcl2!stealth.acf.nyu.edu!brnstnd From: brnstnd@stealth.acf.nyu.edu Newsgroups: comp.unix.questions Subject: Re: looking for C language file differ Message-ID: <539:Jun114:19:3590@stealth.acf.nyu.edu> Date: 1 Jun 90 14:19:35 GMT References: <1990May31.185500.29790@cbnewsd.att.com> Reply-To: brnstnd@stealth.acf.nyu.edu (Dan Bernstein) Distribution: usa Organization: IR Lines: 18 In article <1990May31.185500.29790@cbnewsd.att.com> jlash@cbnewsd.att.com (john.k.lash) writes: > Does anyoue have or know of a "syntax tolerant" diff program for C files? It sounds like you want to pipe both programs through a reindenter before diffing them. To keep track of the original line numbers, your safest bet is to use cpp and then add /* 356 */, /* 357 */, ... > Also, it should ignore equivalent functions at different places in the > source files. I could add lots of other things like ignoring differences > in the ordering of local variables, #defines, and structure definitions. cpp handles any #define trickery. For the reordering: After a reindent, sort the ``pieces'' of the code into order, where pieces are external declarations, function definitions, etc. This is really easy if your indent can manage to separate pieces by spaces. Similarly sort the local variables within each block. ---Dan