kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

6_5_22b_sizeof_string_literal.c (344B)


      1 /* sizeof on a string literal should yield the size of its char-array
      2  * type per C11 §6.5.3.4 / §6.4.5 — sizeof("abcd") is 5 (4 bytes + NUL).
      3  * Today parse_primary materializes the literal as a `char*` rvalue, so
      4  * sizeof reports pointer size (8 on LP64) instead of the array size. */
      5 int test_main(void) { return (int)sizeof("abcd"); }