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 Fri, Sep 13, 2002 at 01:11:28AM +0100, Joseph S. Myers wrote:
> On Wed, 11 Sep 2002, Marc Espie wrote:
> 
> > in -pedantic mode, gcc complains about %m.
> > But syslog, as per Single Unix, includes %m as a standard format specifier.
> > 
> > Question: how can we support syslog (which looks desireable to me) ?
> > Add a syslog format that is almost printf ?
> > 
> > What would be the logic wrt ansi language variants ? Namely, syslog is not
> > ansi at all. I'd assume no warning at all, as long as the right header is
> > included, and thus no built-in as well...
> > there is no switch corresponding to single unix or posix built-ins yet, right ?

> syslog is treated just like a random user function that wraps the ISO C
> functions (for which ISO C checking with -pedantic is appropriate).  
> Allowing for such functions to vary what standard a particular specifier
> is considered to be in, as well as adding or removing specifiers or
> defining whole new format types, is something that should go in extensible
> format checking (listed as "Maybe eventually" on the projects list).

Okay. I'm just going to look at adding a 'syslog' format, then.
Rationale: there are precious few portable formats, even in single unix.
And format checking is very, very useful in finding some classes of bugs.
Now, considering syslog(), you can very easily see that such bugs can be
critical very easily, as syslog() tends to be encountered in daemons and
such.

So, as it's not a standard we currently recognize, it will just exist as
a format one can add in a header with a prototype for syslog, not a
built-in.

Sounds okay ?


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