------- Comment #4 from jakub at gcc dot gnu dot org 2010-08-12 15:08 ------- Pretty please, before filing further bugs take time and learn C. The pointer subtraction triggers undefined behavior, because one pointer points to one object and the other pointer points to different object. See ISO C99, 6.5.6/9. In particular, in this testcase the functions are inlined and thus i and strp are just normal automatic variables in main, obviously nothing guarantees how they are laid out in the stack. But even if it isn't inlined, the behavior would be undefined.
-- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45265