https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86130
Bug ID: 86130 Summary: Expect SIGBUS but program just silently exits Product: gcc Version: 8.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: p.sanders at alpinesoft dot co.uk Target Milestone: --- Hi guys, My first post here, hope I do things right. The following code snippet just exits the program silently rather than generating SIGBUS as you would expect it to. I don't think what doing that is appropriate. clang *does* generate SIGBUS, and although the code below is, strictly speaking, UB, I don't think gcc should behave as it does, for obvious reasons. OK, here's the code: #include <iostream> int main() { char *p = (char *) nullptr; std::cout << "Watch the " << p << "birdie" << std::endl; return 0; } And here's the output (note: no SIGBUS): Watch the Live demo here (where you can also try running it with clang) https://wandbox.org/permlink/M1S74HqjT1HvLtr0 Sounds like an easy fix. Thanks.