Comment

Comment by saagarjha

Here's one that I encountered that I cannot figure out:

  $ g++ -x c++ -fsanitize=undefined -
  #include <iostream>
  
  int main() {
      int *a = nullptr;
      std::cout << std::addressof(*a) << std::endl;
  }
  ^D
  $ ./a.out
  <stdin>:5:29: runtime error: reference binding to null pointer of type 'int'
  0
parent saagarjha 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton