Title
Null pointers and C compatibility
Status
nad
Section
Clause [Annex] C [diff]
Submitter
Steve Clamage

Created on 1998-10-27.00:00:00 last changed 301 months ago

Messages

Date: 1999-10-15.00:00:00

Rationale (10/99): Because j is not a constant expression in C, this code fragment has implementation-defined behavior in C. There is no incompatibility with C resulting from the fact that C++ defines this behavior.

Date: 2022-02-18.07:47:23

Annex C lists C compatibility issues. One item not in the annex came up in a discussion in comp.std.c++.

Consider this C and C++ code:

    const int j = 0;
    char* p = (char*)j;

Rationale (10/99): Because j is not a constant expression in C, this code fragment has implementation-defined behavior in C. There is no incompatibility with C resulting from the fact that C++ defines this behavior.

History
Date User Action Args
2000-02-23 00:00:00adminsetmessages: + msg295
2000-02-23 00:00:00adminsetstatus: open -> nad
1998-10-27 00:00:00admincreate