Re: [PATCH] Fix -Wformat errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/13/2015 02:03 PM, Stephen Smalley wrote:
> On 03/13/2015 08:55 AM, Petr Lautrbach wrote:
>> Fixes two types of errors which appear when building with gcc-5.0.0
>>
>> - format ‘%d’ expects argument of type ‘int’, but argument X has type ‘unsigned int’
>> - format ‘%a’ expects argument of type ‘float *’, but argument X has type ‘char **’
> 
> %a is the dynamic allocation conversion specified in glibc, at least
> prior to glibc 2.7, and is available if _GNU_SOURCE is specified (which
> is set in CFLAGS in libselinux/src/Makefile).  So your change will break
> on older glibc IIUC.
> 

%ms format string is already used in
libselinux/utils/sefcontext_compile.c and policycoreutils/hll/pp/pp.c


The other way to fix it would be to use -std=gnu89 everywhere since
gcc-5 defaults to -std=gnu11.

Petr
--
Petr Lautrbach


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux