Hacker News new | ask | show | jobs
by DannyBee 4277 days ago
"But there seems to be no way to extend this attribute, nor to make entirely new attributes in the same spirit."

Yes, GCC knows, and we're good with that :)

The glibc extension here serves no earthly purpose (and on the gcc side, we've considered pretending it doesn't exist before so we can actually optimize better).

It sounds like it may be a good idea, except 1. It modifies functions that have a standard purpose, standard set of format specifiers, and are, as you point out, often error checked to make sure they match those :)

2. Unless you see the printf handler registration, which may be in a library, linked to your program, or whatever, you'll have no idea that the code is wrong.