Currently I maintain large C/C++ project (over 400 lib/bin targets and ~100 000 files). It is targeted and ported on Sun (with Sun CC), HPUX (with aCC), Linux (with gcc) and Windows (MSVC). The Sun, HP and Windows compilers have common flags syntax and usage logic of pch functionality (create and use flags, etc). The Gcc chose own way of pch usage (direct *.h compilation and auto finding on Includes path) which force users to complicate build rules for gcc exception.
The creation part is not so problematic than usage because all issues could be solved in build logic (as exception) but usage require bigger influence. The usage is more problematic because typically projects are older that gcc pch support and pch files lay directly in project/targets dirs (plus may have same names in different projects: stdafx.h ;)) which force us to create pch.gch direct in sources (gcc first search *.c/*.cpp dir for includes and pch). This limitation (may) give us many other problems like read-only src's tree, src's tree on dynamic medias, ugly project's which share files :| , playing with pch.gch dir and his contents, etc. Good solution would be -fpch-use=path/file.gch flag which allow us create pch together with obj's files and simple tell gcc where it could be find. -- Summary: Please allow directing pch file localization/usage via direct compiler flag. Product: gcc Version: 3.4.6 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: pch AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bursig at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36277