Hacker News with Generative AI: Clang

A Clang regression related to switch statements and inlining (nicula.xyz)
After my previous post, Eliminating redundant bound checks (read it for context if you haven’t already), I wanted to do a benchmark using the ‘optimized’ version of the increment() function, which didn’t contain any bound checks when compiled with Clang, even though we used .at() for indexing into the array.
Rules to avoid common extended inline assembly mistakes (nullprogram.com)
GCC and Clang inline assembly is an interface between high and low level programming languages. It is subtle and treacherous. Many are ensnared in its traps, usually unknowingly. As such, the asm keyword is essentially the unsafe keyword of C and C++. Nearly every inline assembly tutorial, including the awful ibilio page at the top of search engines for decades, propagate fundamental, serious mistakes, and most examples are incorrect. The dangerous part is that the examples usually produce the expected results!
Bear is a tool that generates a compilation database for Clang tooling (github.com/rizsotto)
Bear is a tool that generates a compilation database for clang tooling.
Notes/Primer on Clang Compiler Front End (1): Introduction and Architecture (youssefaa.com)
Better Firmware with LLVM/Clang (2020) (memfault.com)
OpenBSD – Clang -fret-clean: cleaning return addresses off stack (by deraadt) (undeadly.org)
Clang’s -O0 output: branch displacement and size increase (maskray.me)