FIX: Constructor C4705 Warning from Aggregate Class Member (98989)
The information in this article applies to:
- Microsoft C/C++ for MS-DOS 7.0
- Microsoft Visual C++ 1.0
- Microsoft Visual C++ 1.5
- Microsoft Visual C++ 1.51
- Microsoft Visual C++ 1.52
- Microsoft Visual C++, 32-bit Professional Edition 2.0
- Microsoft Visual C++, 32-bit Professional Edition 2.1
This article was previously published under Q98989 SYMPTOMS
When Microsoft C/C++ compiles an application, it generates the
following message for each class constructor:
warning C4705: statement has no effect
CAUSE
The source code has an embedded aggregate member (class, struct, or
union) in a class definition and the compiler command line includes
the /W4 and /f- compiler options. Note that the /f- option is not
supported in the Microsoft Visual C++ 32-bit compiler.
RESOLUTION
The C4705 warning is incorrect and can be safely ignored. If the
embedded aggregate is a class, define a default constructor. This
will supress the warning.
STATUS
Microsoft has confirmed this to be a bug in the products listed at the
beginning of this article. This problem was fixed in Microsoft Visual C++,
version 4.0.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbbug kbCompiler kbCPPonly kbfix KB98989 |
---|
|