]> git.ipfire.org Git - thirdparty/ccache.git/commit
Remove the unify mode
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 29 Dec 2019 18:21:39 +0000 (19:21 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 2 Jan 2020 20:03:22 +0000 (21:03 +0100)
commit947a72ce3712a6901e7ddc43a50c5df40739113e
tree00998afd38eae2ea7fa0af3a7b79a985f09ed806
parent38419c8dc3712b46020fd02cef6f608bf66c13fe
Remove the unify mode

The unify mode has not received enough attention and has at least these
bugs:

1. The direct mode doesn’t work if the unify mode is enabled. This is
   because the unify mode doesn’t call into process_preprocessed_file
   which stores the paths and hashes of included files needed by the
   direct mode.
2. The .incbin directive detection has no effect when using the unify
   mode. This is again because the unify mode doesn’t use
   process_preprocessed_file which is where the .incbin detection takes
   place.
3. The unifier’s tokenizer doesn’t understand C++11 raw string literals.
4. The unifier ignores comments, but comments may have semantic meaning
   to modern compilers, e.g. “fall through” comments.

Bugs 3 and 4 are fixable by improving the unifier’s tokenization
algorithm, but since it’s a bit tricky it likely won’t be worth the
effort, especially not as a bug fix.

Bugs 1 and 2 are also fixable by unifying the two code paths, but that’s
a non-trivial effort.

In addition to the bugs, I believe that the usefullness of the unify
mode is low:

* It’s only applicable when not using -g.
* It won't be enabled for C++ unless somebody fixes bug 3.
* It can make line numbers in warning messages and __LINE__ expansions
  incorrect.
* Since comments should not be ignored, the unify mode can only make a
  difference for some types of whitespace changes, like adding or
  removing blank lines or changing a+b to a + b. (a + b is already
  normalized to a + b by the preprocessor.)

Therefore I’ll just remove the unify mode to fix the bugs.

Fixes #497.
12 files changed:
Makefile.in
dev.mk.in
doc/MANUAL.adoc
src/ccache.c
src/conf.c
src/conf.h
src/confitems.gperf
src/envtoconfitems.gperf
src/unify.c [deleted file]
src/unify.h [deleted file]
test/suites/base.bash
unittest/test_conf.c