I would like to implement a gcc plugin that can compress an
__attribute__((format(printf, x, y))) const char array before
storage so that the formats can be size reduced when stored and
expanded appropriately before use.

As this is the first plugin I am trying to implement, I'm a bit
lost in details and I am looking for guidance.

Basically:

Take the printf_format_type CONST_DECL format being verified by
gcc/c-format-main.c and after the verification, compress the
format and its length before storage into its .read_only section.

A custom vsnprintf routine would expand the compressed format to
its original form before use.

All tips to necessary gcc plugin implementation details appreciated.

Reply via email to