lvalues and ++

Nathaniel Mishkin mishkin at apollo.uucp
Sat Dec 13 02:35:09 AEST 1986


I am having problems with the construct:

    {
        long i;
        char *p; 

        *((long *)p)++;
    }

Some C compilers (e.g. the one sent with 4.3bsd) complain with the error:

    illegal lhs of assignment operator

Other compilers seem to handle this correctly (incrementing by 4, by the way).

Is this invalid C or is the 4.3bsd compiler broken?

                -- Nat Mishkin
                   Apollo Computer Inc.
                   apollo!mishkin



More information about the Comp.lang.c mailing list