Because undefined behavior == anything can happen. You’re unlucky that it doesn’t crash, this sort of behavior can potentially hide bugs.
As for a
being define twice – that’s a bug in the compiler.
More Related Contents:
- CPP- I am getting Segmentation fault (core dumped)?
- Reading garbage instead of segfault for non-existant memory locations
- segmentation fault in an sorted linked list program for Homework [closed]
- I keep getting a segfault every time I run this program, but I cannot understand why
- Segmentation fault on large array sizes
- What is a segmentation fault?
- Definitive List of Common Reasons for Segmentation Faults
- cudaMemcpy segmentation fault
- Determine the line of code that causes a segmentation fault?
- How to catch segmentation fault in Linux?
- What can cause segmentation faults in C++? [closed]
- Fixing Segmentation faults in C++
- Segmentation fault at glGenVertexArrays( 1, &vao );
- SetJmp/LongJmp: Why is this throwing a segfault?
- Segfaults in malloc() and malloc_consolidate()
- Why is a segmentation fault not recoverable?
- Best practices for recovering from a segmentation fault
- Is #pragma once a safe include guard?
- What does casting to `void` really do? [duplicate]
- (-2147483648> 0) returns true in C++?
- Is there a __CLASS__ macro in C++?
- Is it worth setting pointers to NULL in a destructor?
- Why are my struct’s members not properly initialised using `{}`? [duplicate]
- Default class inheritance access
- What encoding does std::string.c_str() use?
- Why can’t redefine type names in class in C++?
- When to use const char * and when to use const char []
- STL algorithms: Why no additional interface for containers (additional to iterator pairs)?
- How to find substring from string?
- C++ Circular Dependency in Header Files