Re: [Gluster-devel] C99 requirement in Gluster ?

2017-02-24 Thread Michael Scherer
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




signature.asc
Description: This is a digitally signed message part
___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://lists.gluster.org/mailman/listinfo/gluster-devel

Re: [Gluster-devel] C99 requirement in Gluster ?

2017-02-20 Thread Michael Scherer
Le lundi 20 février 2017 à 06:33 -0500, Kaleb Keithley a écrit :
> 
> - Original Message -
> > From: "Michael Scherer" 
> > 
> > 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 ?
> 
> argp-standalone is contrib. Are there newer sources available somewhere?
> 
> > 
> > (and if we do requires c99 already, how come coverty do not use it ?)
> >  
> 
> (For Community Gluster) 
> 
> I'm not aware of any "official" policy to require C99. 
> And how would we enforce it in a community project?

In configure. We can just verify that the compiler is able to compile
C99, and there, we can declare that we are able to use C99 since
supported natively by compiler.


> What we use depends on the platform. For "official" builds we have 3 Fedora 
> platforms, 3 CentOS platforms, 2 or 3 Debian platforms, Ubuntu 4-5 platforms, 
> SuSE 2 or 3 platforms, plus NetBSD (still gcc?) and FreeBSD (clang).  We also 
> compile with clang on Linux (and probably nobody ever looks at the results.)  
> And then there's whatever the individual developers are developing on, but 
> that's 
> probably one of the above.
> 
> On top of that the various packaging building configs on those platforms add 
> more options.

Sure, but so, what is the minimal C standard we should support, and
then, how do we know we do not requires a newer standard ?

If it was C11, I can see why it would be problematic, but C99 should be
rather straight forward.
-- 
Michael Scherer
Sysadmin, Community Infrastructure and Platform, OSAS




signature.asc
Description: This is a digitally signed message part
___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://lists.gluster.org/mailman/listinfo/gluster-devel

Re: [Gluster-devel] C99 requirement in Gluster ?

2017-02-20 Thread Niels de Vos
On Mon, Feb 20, 2017 at 06:33:24AM -0500, Kaleb Keithley wrote:
> 
> 
> - Original Message -
> > From: "Michael Scherer" 
> > 
> > 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 ?
> 
> argp-standalone is contrib. Are there newer sources available somewhere?

Ideally this is not used anywhere anymore and the library provided by
the target distribution is linked instead. Maybe it is finally time to
remove contrib/argp-standalone ?

Niels


signature.asc
Description: PGP signature
___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://lists.gluster.org/mailman/listinfo/gluster-devel

Re: [Gluster-devel] C99 requirement in Gluster ?

2017-02-20 Thread Kaleb Keithley


- Original Message -
> From: "Michael Scherer" 
> 
> 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 ?

argp-standalone is contrib. Are there newer sources available somewhere?

> 
> (and if we do requires c99 already, how come coverty do not use it ?)
>  

(For Community Gluster) 

I'm not aware of any "official" policy to require C99. And how would we enforce 
it in a community project?

What we use depends on the platform. For "official" builds we have 3 Fedora 
platforms, 3 CentOS platforms, 2 or 3 Debian platforms, Ubuntu 4-5 platforms, 
SuSE 2 or 3 platforms, plus NetBSD (still gcc?) and FreeBSD (clang).  We also 
compile with clang on Linux (and probably nobody ever looks at the results.)  
And then there's whatever the individual developers are developing on, but 
that's probably one of the above.

On top of that the various packaging building configs on those platforms add 
more options.

--

Kaleb




___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://lists.gluster.org/mailman/listinfo/gluster-devel


[Gluster-devel] C99 requirement in Gluster ?

2017-02-19 Thread Michael Scherer
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 ?)
 
-- 
Michael Scherer
Sysadmin, Community Infrastructure and Platform, OSAS




signature.asc
Description: This is a digitally signed message part
___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://lists.gluster.org/mailman/listinfo/gluster-devel