Joerg Schilling wrote: > James Carlson <carlsonj at workingcode.com> wrote: > >> Turning that mechanism into a string should be fairly straightforward: >> >> "a:#:inaddr_t" >> >> ... or some such. I suspect that there won't be gcc compatibility here, >> because gcc doesn't give a hoot about the /* PRINTFLIKE */ that Studio >> uses anyway, so extending that mechanism shouldn't require substantial >> coordination. Hey, maybe it can lead the gcc feature. >> >> I'd suggest this: >> >> /* PRINTFLIKE1 f:: e:: g:: a:#:inaddr_t m::void */ >> >> as a way of saying "like printf, but doesn't accept %f, %e, or %g, has >> %a with inaddr_t argument and optional # modifier, and has a %m that >> takes no argument." > > How do you like to write down %r that takes two arguments?
It's an exercise for the folks doing the detailed design, but a suggestion would be something like "r::const char *,va_arg". The primary suggestion I'm making here is to reduce it to a fairly simple language that can be encoded in the existing comment structure. Precisely how that's done is really unimportant; anything that solves the problem would be nice. An over-the-top design might have a plug-in architecture that would allow users to code up modules that customize behavior in certain places. That'd also be doable, and quite a bit more flexible, but I'm more interested in the simple mdb_printf/cmn_err/syslog problem, which could be solved by a smaller mechanism. -- James Carlson 42.703N 71.076W <carlsonj at workingcode.com>
