This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] analysis of global statics and removal associated vdefs and vuses


Kenneth Zadeck wrote:

> I do not understand
> what the user defined callbacks are, jeff keating did not mention these
> to me when we talked about this.  However, he was wearing a standards
> hat while we were talking.

In glibc, it is possible to register a function as a callback to format
special arguments. This way you can enhance printf() with more formatters
(like GCC's %T for types, %E for expressions, etc.) which are specific to
your application.

Thus, printf() could call functions in your code which in turn may clobber
static globals. You cannot rely on glibc's printf() not modifying your
globals.

Giovanni Bajo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]