Warning C4097

Warning C4097

Post by Murrgo » Thu, 16 Sep 2004 23:42:14


I am getting warning C4097 when compiling some code that uses
basic_string. The warning comes from the stl implementation of
one of the erase() functions of basic_string. Is this something
I should be concerned about, or can I ignore it?
 
 
 

Warning C4097

Post by Pete Becke » Fri, 17 Sep 2004 08:31:28


According to MSDN, C4097 is a warning about an invalid pragma. That
doesn't sound like anything you'd run into in one of the erase functions
of basic_string. What does the warning say?

--

Pete Becker
Dinkumware, Ltd. ( http://www.yqcomputer.com/ )

 
 
 

Warning C4097

Post by Murrgo » Fri, 17 Sep 2004 22:27:51


Hmmm, I am using VC6 and C4097 is not about invalid pragma. Here is
the stuff from the docs:

"Compiler Warning (level 3) C4097
typedef-name 'identifier1' used as synonym for class-name 'identifier2'

A typedef name which names a class is itself a class name. However, only a
class declared without a tag can be named. In the following line of code the
typedef name P is promoted to class name but Q is not.

typedef struct { int member; } P, Q;

Q remains a normal typedef name and a synonym for the class.

The following example causes this warning:

typedef struct _T
{
int i;
} T;

struct U : T
{
int j;
}; // warning

struct V : _T
{
int j;
}; // OK"
 
 
 

Warning C4097

Post by Pete Becke » Fri, 17 Sep 2004 23:05:17


Well, that's interesting. MSDN doesn't have that, but there's an old KB
article that says the same thing. It sounds like the result of a
hypertechnical reading of a pre-standard language description, and it
doesn't surprise me that it's gone away. Don't worry about it.

--

Pete Becker
Dinkumware, Ltd. ( http://www.yqcomputer.com/ )