Liangxu Linux
Liangxu Linux
Apr 5, 2024 · Fundamentals

Why Zero‑Length Arrays Matter in Linux Kernel Development

This article explains what zero‑length arrays are, how they are defined in C, why they appear frequently in the Linux kernel as flexible array members, and provides a complete kernel‑style implementation showing creation, expansion, and cleanup of a dynamically sized integer array.

C++Dynamic memory allocationFlexible array member
0 likes · 10 min read
Why Zero‑Length Arrays Matter in Linux Kernel Development
Liangxu Linux
Liangxu Linux
Aug 14, 2023 · Backend Development

Mastering GNU C Extensions: typeof, Zero‑Length Arrays, and More in the Linux Kernel

This article explains key GNU C extensions used in the Linux kernel—including typeof, zero‑length (flexible) arrays, case ranges, labeled initializers, variadic macros, function and variable attributes, built‑in functions, asmlinkage, and UL suffixes—showing why they exist, how to use them safely, and providing concrete code examples.

GNU CLinux kernelbuiltin function
0 likes · 13 min read
Mastering GNU C Extensions: typeof, Zero‑Length Arrays, and More in the Linux Kernel
Liangxu Linux
Liangxu Linux
Mar 18, 2023 · Fundamentals

Mastering GNU C Extensions: typeof, Zero‑Length Arrays, Case Ranges and More in the Linux Kernel

This article explains key GNU C extensions used throughout the Linux kernel—including typeof, zero‑length (flexible) arrays, case range labels, designated initializers, variadic macros, function and variable attributes, built‑in functions, asmlinkage and UL suffixes—showing why they exist and how to apply them safely with concrete code examples.

GNU CLinux kernelbuiltins
0 likes · 13 min read
Mastering GNU C Extensions: typeof, Zero‑Length Arrays, Case Ranges and More in the Linux Kernel