[Debian-med-packaging] Trying to disable error=format-security for clapack

Danny Edel debian at danny-edel.de
Mon May 16 11:50:39 UTC 2016


On 05/16/2016 11:07 AM, Andreas Tille wrote:
> /build/clapack-3.2.1/F2CLIBS/libf2c/arithchk.c:125:2: error: format not a string literal and no format arguments [-Werror=format-security]
>   Cray1 = printf(emptyfmt) < 0 ? 0 : 4617762;

Hi Andreas,

you should have success with changing the type (insted of the value) of
emptyfmt, rather than disabling any warnings.

Right now it's "char *", which is legal C, but problematic, since
character literals are not allowed to be written to anyway and might
even be placed in read-only memory[1].  Just the type "readwrite pointer
to readwrite character" probably triggers the warning.

If you change it to "const char* const", the compiler is assured it's
never going to point to anything else and does not emit the warning.

Cheers,

- Danny

[1]: http://en.cppreference.com/w/c/language/string_literal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: format-security.patch
Type: text/x-patch
Size: 298 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debian-med-packaging/attachments/20160516/223c9a90/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/debian-med-packaging/attachments/20160516/223c9a90/attachment.sig>


More information about the Debian-med-packaging mailing list