This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

casting an lvalue in C++


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]