This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
casting an lvalue in C++
- To: gcc-bugs at gcc dot gnu dot org
- Subject: casting an lvalue in C++
- From: Andrew Pimlott <pimlott at idiomtech dot com>
- Date: Tue, 28 Dec 1999 03:47:16 -0500
g++ and Visual C++ disagreed about some code like this:
int main(int argc, char **argv)
{
char *c;
void *v;
(void *) c = v;
}
g++ -Wall compiled it without warnings, but Visual C++ complained that
the left side is not an lvalue. I found a microsoft document that says
it is right according to the C++ standard:
http://support.microsoft.com/support/kb/articles/Q88/4/34.ASP .
I assume that g++ should warn about non-standard constructs even if it
can compile them, right?
Andrew