a.c (266B)
1 /* STB_WEAK + SHN_UNDEF: weak extern function declared but never defined. 2 * Its address resolves to NULL; test guards before calling. */ 3 extern __attribute__((weak)) int weak_fn(void); 4 int test_main(void) { 5 if ((void*)weak_fn != (void*)0) return 1; 6 return 0; 7 }