This is the mail archive of the gcc@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: formats and syslog question


On Sat, Sep 14, 2002 at 10:44:58AM +0100, Joseph S. Myers wrote:
> On Fri, 13 Sep 2002, Jonathan Lennox wrote:
> 
> > Is the '#pragma varargck' approach used by Plan 9's C compiler
> > (<http://plan9.bell-labs.com/magic/man2html/1/2c>) at all useful as a
> > starting point?  It doesn't have all the functionality you describe, but it
> > allows specifiers and flags to be specified, and lets you define what
> > argument types the specifiers consume.
> 
> It hardly helps here since it doesn't allow anything like "same as printf
> but %m is OK with -pedantic".  (Any syntax for GCC clearly shouldn't be
> based on #pragma, either; and should be able to cover what the existing
> data structures in c-format.c do, except perhaps for
> FMT_FLAG_SCANF_A_KLUDGE for which a more orthogonal solution would be
> desirable.)

I feel that I'm not getting heard, here.

I concur that a generic way to specify formats would be nice.
However, I am not going to do it. And nobody is going to embark on this
right now, it looks like.

*But* there is a concrete need for a syslog() format *right now*.
It is very useful from a security point of view.

And it's completely cross-platform. syslog exists on every unix platform,
and %m is standard for it on most of it (since it's specified in Single
Unix).

Compare this to all the other samples of functions which were given that
are much more exotic (linux's printk INCLUDED).

How does it hurt to have this added in the FSF tree ?
Okay, it's bloat.

Wow. What bloat. An extra entry in a format table and three pesky lines of
code.

Give me a single example of a function that understands formats that's not
supported yet and that is as wide-spread as syslog...

Granted, I can do this in my tree (and I will), but come on, this can be
of use to everyone right now.

Why wait for years until someone finally embarks on specifying a format
language ? which is going to be either highly esoteric, OR a very large
piece to add to gcc yet...


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