...
Code Block | ||||
---|---|---|---|---|
| ||||
#include (stdio<stdio.h> void func(void) { int a = 14; int b = sizeof(a); ++a; printf("%d, %d\n", a, b); } |
...
...
Noncompliant Code Example (sizeof
, VLA)
...
Code Block | ||||
---|---|---|---|---|
| ||||
#include <stddef.h> #include <stdio.h> void f(size_t n) { /* n must be incremented */ size_t a = sizeof(int[++n]); /* n need not be incremented */ size_t b = sizeof(int[++n % 1 + 1]); printf("%z, %z, %z\n", a, b, n); /* ... */ } |
Anchor
Compliant Solution (sizeof
, VLA)
...