Akim Demaille wrote: > First, it was my understanding that diff was supposed to compare > text files, which, for me, meant ignoring the difference between > DOS-EOL and Unix-EOL. The Autoconf documentation reads: > > `cmp' > `cmp' performs a raw data comparison of two files, while `diff' > compares two text files. Therefore, if you might compare DOS > files, even if only checking whether two files are different, use > `diff' to avoid spurious differences due to differences of newline > encoding. > > So I believed merely using 'diff' sufficed. I can confirm that on > this macOS box, GNU diff does not ignore the difference between \r\n > and \n, unless I pass the --strip-trailing-cr option.
FYI, I see the same behaviour on Linux. I suppose the intention is to compare according to what the local system considers "text files", i.e. \n on Unix/Mac, and either \n or \r\n on DOS/Windows. So the Autoconf documentation should probably be read in this context, though it certainly could be clearer on that. Regards, Frank