PRB: /Tp and /Tc Show Unexpected Behavior with Wildcards (85498)
The information in this article applies to:
- Microsoft Visual C++ for Windows, 16-bit edition 1.0
- Microsoft Visual C++ for Windows, 16-bit edition 1.5
- Microsoft Visual C++, 32-bit Editions 1.0
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Editions 4.2
- Microsoft Visual C++, 32-bit Editions 5.0
This article was previously published under Q85498 SYMPTOMS
When compiling multiple .CPP or .CXX files using a wildcard syntax and the
/Tc command line option, for example
cl /Tc *.cpp
the C compiler is invoked only for the first source file matching the
wildcard specification. For all subsequent files, the C++ compiler is
invoked. The inverse is also true. That is, when compiling multiple .C
files using a wildcard syntax and the /Tp command line option, the C++
compiler is invoked only for the first file; for all subsequent files, the
C compiler is invoked.
CAUSE
This behavior is by design. As stated in the online and hard copy
documentation for Microsoft C/C++ version 7.0 and all versions of Microsoft
Visual C++ 16- and 32-bit Editions, the following is the correct syntax for
the /Tc and /Tp command line options:
/Tc<filename> -or- /Tc <filename>
/Tp<filename> -or- /Tp <filename>
Each option refers to only one source file. Therefore, the first file
matching the wildcard specification will be compiled as directed by the
corresponding /T? option. All other files matching the wildcard will be
compiled in accordance with their extension. (The C compiler is invoked for
.C files, the C++ compiler for .CPP or .CXX files.)
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbCompiler kbprb KB85498 |
---|
|