[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: issue with `diff -D`

From: Bob Proulx
Subject: Re: issue with `diff -D`
Date: Thu, 22 Apr 2010 03:06:52 -0600
User-agent: Mutt/1.5.18 (2008-05-17)

Igor wrote:
>    #ifndef __x86_64___
>    /* some comment
>    #else /* __x86_64__ */
>    /* some DIFFERENT comment
>    #endif /* __x86_64__ */
>     */
> ...
> I don't know if this is a bug or if stuff was made simple since diff is  
> not a C parser, however, reported.

As you say, stuff was made simple.  The diff program doesn't parse the
C code.  It simply creates a diff based upon the differences in the
file.  If you had used diff -u you would have seen a more normal diff
output and the differences would have shown:

  -/* some comment
  +/* some DIFFERENT comment
   int somefunc();

The -D option wraps the diff in cpp ifdef constructs.  It is a textual
convenience.  But it isn't going to perfectly handle pathological

Thanks for the report just the same!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]