[Gluster-devel] C99 requirement in Gluster ?
Michael Scherer
mscherer at redhat.com
Fri Feb 24 08:46:23 UTC 2017
Le dimanche 19 février 2017 à 11:57 +0100, Michael Scherer a écrit :
> Hi,
>
> so I was reading coverty scan reports (as Nigel tricked me into looking
> them), and one of the first is this:
> https://download.gluster.org/pub/gluster/glusterfs/static-analysis/master/glusterfs-coverity/2017-02-07-3c86d946/html/1/8rpc-transport.c.html#error
>
> at first, i was wondering why/what is the issue.
>
> But, after searching, int8_t is a C99 type, which is signed when
> compiled on C99 compiler, and likely unsigned when compiled using a non
> C99 compiler (as I see in ./contrib/argp-standalone/acinclude.m4 , it
> will be defined to "char" on non c99 platform, which also make no
> garantee on being signed or unsigned, according to
> https://stackoverflow.com/questions/4337217/difference-between-signed-unsigned-char ).
>
> So, to fix that, should we force to use c99, or update argp-standalone ?
>
> (and if we do requires c99 already, how come coverty do not use it ?)
So it turn out this did bugged me, and I just choose the joker "ask to a
friend", who told me the trick with that specific error:
https://review.gluster.org/#/c/16738/
(in short, using int8_t instead of int mean there is a possible
truncation since strcmp can return 256, which become 0 once converted)
So there is no C99 migration or anything needed.
--
Michael Scherer
Sysadmin, Community Infrastructure and Platform, OSAS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.gluster.org/pipermail/gluster-devel/attachments/20170224/899ea625/attachment.sig>
More information about the Gluster-devel
mailing list