Skip to content

Instantly share code, notes, and snippets.

View d11z's full-sized avatar
:octocat:
Learning

d11z d11z

:octocat:
Learning
View GitHub Profile
@d11z
d11z / Quirks of C.md
Created March 18, 2022 18:42 — forked from fay59/Quirks of C.md
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;