kit

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

03_weak_def.c (280B)


      1 /* Exercises STB_WEAK: a weak function definition and a weak object.
      2  * Both must round-trip with STB_WEAK binding preserved. */
      3 
      4 __attribute__((weak)) int weak_fn(void) { return 42; }
      5 
      6 __attribute__((weak)) int weak_var = 7;
      7 
      8 int call_weak(void) { return weak_fn() + weak_var; }