News for hackers. Stuff that matters.
Re:Function overloading in C by kazinator on Sunday July 26, 2015 @01:25PM (#9951626)
I want to pass a function as a pointer even though it is overloaded. C++ supports that. For instance if we do:

   int (*p)(int, int) = add;
overload resolution kicks in there.

I want detailed error messages about overload resolution. Maybe not all the time: give me the executive summary ("no suitable overload of add was found") and the details if I specify some "-Woverload-detailed" option or whatever. That's a quality of implementation matter; neither ISO C nor ISO C++ spell out what diagnostics should look like and how detailed they should be.

Token-level macros are hacky cruft that shouldn't be used as the development bed for new features, period. All this stuff ignores 35 years of progress in the C dialect scene alone, not to mention 60 years of progress in general.

Above, add isn't even what is understood in computing as a "first class function". If we make it into some hacky macro, we are taking away even that second class status away from it.

Re:Function overloading in C by nothrabannosir on Sunday July 26, 2015 @02:02PM (#9951725)
> I want to pass a function as a pointer even though it is overloaded. C++ supports that.

That's his point: C _Generic and C++ are not the same. Which one is better was not his point, just that they're different.

Re:Function overloading in C by kazinator on Sunday July 26, 2015 @02:39PM (#9951826)
> Which one is better was not his point, ...

The comment is loaded with judgment, and the word "better" actually occurs.