> > > A codebase I'm working with has decided that poisoning certain > standard library functions is necessary, as it explicitly does not use > those functions unless absolutely necessary for its own reasons (This > was not my decision to make). As such, we've been looking into ways to > implement that. > > The problem is there's really no way at all to forbid standard library > functions. The crucial thing is that this mechanism must have a > disable switch for when a callsite must actually call a forbidden > function, complicating the whole process. > > It would be nice to have compiler support to help with this.
I would recommend writing your GCC plugin which would add some problem specific pragmas. Some code from https://github.com/bstarynk/bismon might be improved (by you or your colleagues/interns) to fit into latest GCC version. See http://www.starynkevitch.net/Basile/bismon-chariot-doc.pdf and https://www.decoder-project.eu In some cases, https://frama-c.com/ could also be useful. Regards. -- Basile STARYNKEVITCH <bas...@starynkevitch.net> 8 rue de la Faïencerie http://starynkevitch.net/Basile/ 92340 Bourg-la-Reine https://github.com/bstarynk France https://github.com/RefPerSys/RefPerSys