~/talk

Composite Array Types in C

Talkat NDC TechTown 2025 · 2025-09-22..09-25· [c-and-cpp]
slides:none on file

C’s composite-type rules cause surprising undefined behavior when array sizes come from runtime or unevaluated expressions: unevaluated VLA size creates UB (examples show arrays like 10 vs runtime n, and mismatched 8 vs 7), and conditional operators plus tentative definitions trigger it. C23/C2Y changes reclassify many cases as diagnostics or constraints so that C23 makes it a constraint violation and composite rules differ for conditional operators and prototypes, reducing but not eliminating pitfalls.

AI-written summary · about

  1. 0:00Introduction
  2. 1:27Arrays in C basics
  3. 3:37Composite types in C
  4. 5:02Composite types explained
  5. 7:27Tentative definitions
  6. 10:20Defects in prototype rules
  7. 11:27Array size specifications
  8. 13:36VLAs and undefined behavior
  9. 16:34Unspecified/unknown lengths
  10. 17:36Flexible array members
  11. 18:39Constant vs variable length
  12. 20:11C23 composite rules
  13. 21:17Known constant length arrays
  14. 22:43Undefined behavior in mismatches
  15. 26:47VLAs composite types
  16. 28:15Undefined behavior unequal sizes
  17. 31:13Unspecified length arrays
  18. 32:00C23 array rules summary
  19. 33:47Avoiding pitfalls
  20. 36:38Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.