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: [RFC]: designing customizable format attributes


On Sat, 9 Jul 2005, Kaveh R. Ghazi wrote:

>  > For a start, the general sequence of components in a format is
>  > hardcoded rather than the structures listing the sequence in which
>  > to look for various types of component, and FMT_FLAG_SCANF_A_KLUDGE
>  > is exactly that - a kludge which hasn't yet been eliminated but
>  > should not be hardwired in.
> 
> By "components" you mean e.g. flags, precision, length modifiers, etc?
> And so by "sequence of components", is your complaint that we hardcode
> their order?

Yes, and that there's a lot in common between the code for handling 
different parts (e.g. width and precision), which at present is duplicated 
code.

> And what you would like is a general syntax (and therefore also the
> underlying infrastructure) to support arbitrary components in
> arbitrary order?

I would like the infrastructure improved to continue moving information 
about formats from the code into the datastructures.  I think the current 
datastructures are in a hopelessly premature state to work on syntax for 
defining them from source files.

I think extensible format checking is something which would be nice in 
principle but in practice is almost certain to lead to more long term 
maintenance burden than it is worth.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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