Bug 11575 - Changes in commented out code trigger preprocessing step
Summary: Changes in commented out code trigger preprocessing step
Alias: None
Product: ccache
Classification: Unclassified
Component: ccache (show other bugs)
Version: 3.2
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Joel Rosdahl
QA Contact: Joel Rosdahl
Depends on:
Reported: 2015-10-26 11:01 UTC by Yevhen Ivannikov
Modified: 2015-10-27 21:19 UTC (History)
0 users

See Also:

source file to reproduce the bug (63 bytes, text/x-c++src)
2015-10-26 11:01 UTC, Yevhen Ivannikov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yevhen Ivannikov 2015-10-26 11:01:28 UTC
Created attachment 11533 [details]
source file to reproduce the bug

Prior to version 3.2 changes in commented out code were not considered at all and did not result in preprocess step. With version 3.2 and onwards, a single change in commented out code ends up in invoking preprocessor.

This is especially noticeable with __DATE__ / __TIME__ macros. In case of __TIME__ macro the end result is that the source file gets preprocessed on every run.

Most likely the regression is due to the following change in 3.2 release:
"Improved efficiency of the algorithm that scans for __DATE_ and __TIME__ tokens in the hashed source code."
Comment 1 Joel Rosdahl 2015-10-26 21:54:51 UTC
Thanks for the bug report!

The changed behavior was a conscious choice, not a regression. See the discussion in these two threads for some background:


On a side note: ccache 3.1.11 no longer ignores comments because of this bug fix: https://git.samba.org/?p=ccache.git;a=commit;h=2f8422af65c44526e3d54d961be1134a5c225aac

Closing as wontfix, sorry.
Comment 2 Yevhen Ivannikov 2015-10-26 22:19:18 UTC
Then perhaps it would be nice if you update the man page, because it still (v. 3.2.4) states the old behaviour:

 If "__TIME__" is present int the source code outside comments...
 If "__DATE__" is present in the source code outside comments...

Comment 3 Joel Rosdahl 2015-10-27 21:19:44 UTC
Certainly, thanks!

Corrected in https://git.samba.org/?p=ccache.git;a=commit;h=5d8ba5552951dc0d889f7bbf068b54cb797bb2fc.