Microsoft KB Archive/139476

= FIX: File Time Incorrect After Saving During Build =

Article ID: 139476

Article Last Modified on 12/2/2003

-

APPLIES TO


 * Microsoft Visual C++ 4.0 Standard Edition
 * Microsoft Visual C++ 4.1 Subscription
 * Microsoft Visual C++ 4.2 Enterprise Edition
 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 4.2 Professional Edition
 * Microsoft Visual C++ 5.0 Professional Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition
 * Microsoft FORTRAN PowerStation 32

-



This article was previously published under Q139476



SYMPTOMS
If a source file is saved while the project is being built, the relationships between the source file and the .obj file may be incorrect. The saved source file may have an earlier date than the .obj file that was created from the previous version of the source file.



CAUSE
The problem of file modify or save time being incorrect is caused by the Developer's Studio doing front-end processing on all the files before it creates the .obj files. This makes it possible to save a changed file after the earlier version was processed but before the .obj file is created.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This problem was corrected in Microsoft Visual C++ .NET.



Steps to Reproduce Problem

 * 1) Open one of the files in a project, but don't open the file that will be used to create a .pch file (Stdafx.cpp in an MFC application).
 * 2) Start a Rebuild All.
 * 3) Introduce a syntax error in the open file, but do not save it.
 * 4) While the Rebuild All progresses, look in the output window, and wait for it to compile the open file.
 * 5) As soon as it finishes compiling the file, and before it says "Generating Code," save the changed file that has a syntax error. Because the changes occurred after the front end of the compiler has processed the file, there will be no errors in the build. The .obj file will however have a later date because it was created in the "Generating Code" phase.
 * 6) Do a Build (not a Rebuild All). Nothing will happen, and the changed file will not be compiled.
 * 7) Look at the dates of the files, and confirm that the .obj file is newer than the file that was changed.

Additional query words: utilities

Keywords: kbbug kbfix kbnoupdate kbide KB139476

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.