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]
Other format: [Raw text]

[Bug c/13038] no diagnostic for null pointer misuse


------- Additional Comments From falk at debian dot org  2003-11-13 14:59 -------
I don't see the error. The cast to int is not an integer constant expression,
but the standard allows an implementation to accept other integer constant
expressions. The value of the cast is implementation defined; gcc defines it to
be 0. So we have an integer constant expression with value 0, which is just
fine to initialize a pointer.

IMHO, at most, a cast from pointer to int used in a constant integer expression
could give a warning, since this is a GCC extension.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13038


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