I'm using diffutils 3.9. I also compiled from source and see the same issue. file1: Here is some old line. file2: Here is some new line. % diff-3.8 -D NEW file1 file2 #ifndef NEW Here is some old line. #else /* NEW */ Here is some new line. #endif /* NEW */ % diff-3.9 -D NEW file1 file2: Here is some old line. Here is some new line. Reproducible: Always Steps to Reproduce: 1. use "diff -D NEW file1 file2" where file1 and file2 are different 2. 3. Actual Results: Here is some old line. Here is some new line. Expected Results: #ifndef NEW Here is some old line. #else /* NEW */ Here is some new line. #endif /* NEW */ I compiled diffutils 3.8 from GNU and it works OK.
I see it is fixed in the upstream git tree: https://git.savannah.gnu.org/git/diffutils.git The fix is to src/diff.c line 419: (in the diffutils-3.9 source) < for (i = 0; i < sizeof sizeof C_ifdef_group_formats; i++) > for (i = 0; i < sizeof C_ifdef_group_formats; i++)
FEDORA-2023-40ec8ba630 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-40ec8ba630
FEDORA-2023-40ec8ba630 has been pushed to the Fedora 38 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-40ec8ba630` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-40ec8ba630 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2023-40ec8ba630 has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report.