[collectd] cpu.c is actually C99

Florian Forster octo at collectd.org
Sat Nov 25 08:11:40 CET 2017


Hi Mike and Konstantin,

On Fri, Nov 24, 2017 at 09:51:52PM +0300, Konstantin Tokarev wrote:
> > ---
> > This was a new overloaded meaning given to static in C99. It is more than a
> > decade and a half old, but not all compiler writers have embraced all of C99
> > features -- so C99 as a whole largely remains unknown. – Happy Green Kid Naps
> > --- https://stackoverflow.com/a/16314194/94687
> 
> ...and compilers without C99 support remain unusable for many software packages
> 
> https://github.com/collectd/collectd/blob/master/README#L709-L710

the Stackoverflow quote is overly dramatic: commonly used compilers
support the commonly used C99 features. "Mixed declarations", i.e.
declaring new variables anywhere in the block, not just the beginning,
are very widely supported and collectd's sources make extensive use of
the feature.

Using "static" for array arguments is one of the more arcane features in
C99 and support from compilers is poor. GCC and clang essentially treat
this similarly to the __attribute__((nonnull(i))) function attribute. If
this is causing trouble, I'd be in favor of simply removing these uses
of "static".

Best regards,
—octo
-- 
collectd – The system statistics collection daemon
Website: http://collectd.org
Google+: http://collectd.org/+
GitHub:  https://github.com/collectd
Twitter: http://twitter.com/collectd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20171125/0eee6437/attachment.sig>


More information about the collectd mailing list