> > Yeah, BFD can only do that because it forces the %A %B specifiers be > > in the front. > > No, it's worse than that. %A and %B can appear anywhere in the format > string, but consume their args first. eg. > > _bfd_default_error_handler ("section %d is called %A", sec, 1); > > Alan Modra
Oh... ick, I didn't realize that. It means my numbers for format errors in bfd were off because GCC counted positional mismatches as bugs in note #1 here: http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00693.html GCC's current infrastructure doesn't seem suited to handle this style. The clostest I can shoehorn it is that it's really two separate formats, one with %A and %B ignoring all other specifiers and checking against the first N arguments. Then check all other specifiers ignoring %A and %B against arguments N+1 until the end. (Where N equals the number of %A and %B appearances.) We can actually do that in GCC by creating two separate formats. The trick is to calculate N on the fly and apply both formats against the "right" arguments. I haven't figured out how to solve that without major surgery on GCC. I don't know how wedded to this style the bfd folks are, but perhaps we can modify bfd sources into a more conforming format compatible with GCC's format checking. However it requires tweeking BFD sources. I wouldn't consider doing that until format checking is in place so that we'll know if we introduce bugs into bfd in this conversion. --Kaveh -- Kaveh R. Ghazi [EMAIL PROTECTED]