Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.20.1601240001510.10131@monopod.intra.ispras.ru>
Date: Sun, 24 Jan 2016 00:05:36 +0300 (MSK)
From: Alexander Monakov <amonakov@...ras.ru>
To: musl@...ts.openwall.com
cc: Hauke Mehrtens <hauke@...ke-m.de>
Subject: Re: [PATCH] Add format attribute to some function
 declarations

On Sat, 23 Jan 2016, Hauke Mehrtens wrote:

> GCC and Clang are able to check the format arguments given to a
> function and warn the user if there is a error in the format arguments
> or if there is a potential uncontrolled format string security problem
> in the code. GCC does this automatically for some functions like
> printf(), but it is also possible to annotate other functions in a way
> that it will check them too. This feature is used by glibc for many
> functions. This patch adds the attribute to the some functions of musl
> expect for these functions where gcc automatically adds it.

Here's how a similar change was done the last time around:
http://git.musl-libc.org/cgit/musl/commit/?id=ccc71e0ea881b7f6594ed95afd706442829c39fc

Note that that approach avoids repeating #ifdef __GNUC__ ...

How did you choose which functions from stdio.h to annotate?  Are you saying
that gcc is unaware of snprintf while it recognizes sprintf?

Thanks.
Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.