Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Typo, removing useless anchors

...

Code Block
bgColor#ccccff
langc
#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
bgColor#FFcccc
langc
#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);
  /* ... */
}

Anchorcs_vlacs_vla 

Compliant Solution (sizeof, VLA)

...