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 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).

-std options for standards such as Single Unix that add to ISO C would be
of some use (avoiding -pedantic warnings for the features they add to
*printf), but wouldn't help with syslog since %m is only a syslog format
in Single Unix, not a general printf one.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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