C patterns for C23 changes, compiler defaults, string and memory safety, integer overflow, signals, and CERT C rules. Load before any edit to a .c or .h file, however small, and for C questions.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of C Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ku5ic-c-patterns)
---
name: c-patterns
description: C patterns for C23 changes, compiler defaults, string and memory safety, integer overflow, signals, and CERT C rules. Load before any edit to a .c or .h file, however small, and for C questions.
---
# C patterns
Default assumption: C23, ISO/IEC 9899:2024, per the WG14 projects page. C2y has no published version.
A standard row applies when the build's `-std` or `/std`, else the compiler's default, is at least its standard, and a compiler row when the project's compiler is at least that release. GCC 15 and later default to `gnu23`, GCC 8 to 14 to `gnu17`, and Clang 23 to `gnu17`. MSVC compiles C89 with Microsoft extensions unless `/std:c11`, `/std:c17`, or `/std:clatest` is set, and its C23 support lacks `constexpr`, `auto`, `#embed`, `_BitInt`, and first-class `true` and `false`.
A `.h` header also loads cpp-patterns, since it may be C++.
## Reference files
Loading this skill isn't enough. Before your next edit, read the file of every row that matches it. The rules live in those files, and this one only points at them.
| Before | Read |
| ---------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| Writing C code, raising `-std`, or upgrading the compiler | [reference/upgrades.md](reference/upgrades.md) |
| Writing, changing, or reviewing C code | [reference/anti-patterns.md](reference/anti-patterns.md) |
| Setting a build's warning or hardening flags | [reference/practices.md](reference/practices.md) |
| Configuring compiler warnings, `-fanalyzer`, clang-tidy, cppcheck, sanitizers, or clang-format | [reference/tooling.md](reference/tooling.md) |