Diane Trout (alienghic) wrote,
Diane Trout
alienghic

#include <list>
#include <iostream>

int main()
{
  std::list::const_iterator i;
  i++;
  i++; // I don't know why 1 increment is safe but two causes a segfault.
  std::cout << "i'm alive" << std::endl;
}

Under g++, the above code compiles without warnings with g++ -Wall, but when run segfaults. Is this a bug with the STL, or a bug in the compiler? It'd be nice if it either 1) didn't crash or 2) generated a warning about using an uninitialized variable.

Subscribe

  • Guild Wars 2

    I started playing Guild Wars 2, and am happy their questing system has broken with WoW's current quest design. As WoW grew they "simplified" and…

  • calendar.

    Its been a really long time since I tried to write. I keep meaning to roll my own blog software, but there's so many other things I should be doing.…

  • Building debian packages for mozilla's sync server

    I'm surprised this seems to have gotten valid debian packages with a minimum of fuss for a package where I couldn't find a recommended release…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 1 comment