function overload in C


I’m trying to implement an overloading behavior to some of our builtin functions, and came across the following comment in SemaExpr.cpp

// Check for overloaded calls. This can happen even in C due to extensions.

If (Fn->getType() == Context.OverloadTy) { ….

I was wondering which C extensions is this referring to?



#include <stdio.h>
void __attribute__((overloadable)) onearg(int i) { printf("Arg is int: %d\n", i); }
void __attribute__((overloadable)) onearg(char *s) { printf("Arg is string: %s\n", s); }

int main() {
    return 0;

$ clang test.c && ./a.out
Arg is int: 1
Arg is string: String