Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to warn on shadow declaration

📅 2015-Oct-05 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Shadow declarations are a major source of misunderstanding and bugs in C or C++ code. C and C++ allow shadow declarations, but this is one of those features that is better not used in production code that needs to be understood and maintained by multiple people.

Tried with: GCC 5.1 and Ubuntu 14.04