This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
c plugin guidance wanted
- From: Joe Perches <joe at perches dot com>
- To: gcc <gcc at gcc dot gnu dot org>
- Date: Sun, 29 Jul 2018 13:41:24 -0700
- Subject: c plugin guidance wanted
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.