[collectd] ZFS ARC plugin GCC issues; patch

Scott Severtson ssevertson at digitalmeasures.com
Tue May 29 21:02:05 CEST 2012


All,

While compiling CollectD 5.1.0 on Solaris 10 x64 using the default GCC 
version, I ran into a problem compiling the zfs_arch plugin:

zfs_arc.c: In function `za_read_derive':
zfs_arc.c:63: warning: passing arg 2 of `get_kstat_value' discards 
qualifiers from pointer target type
zfs_arc.c: In function `za_read_gauge':
zfs_arc.c:80: warning: passing arg 2 of `get_kstat_value' discards 
qualifiers from pointer target type
*** Error code 1
make: Fatal error: Command failed for target `zfs_arc_la-zfs_arc.lo'


zfs_arc.c's za_read_derive and za_read_gauge functions both define a 
"const char *kstat_value" parameter, but common.h defines 
get_kstat_value as receiving a "char *name" parameter. The quick fix was 
to redefine the kstat_value parameter in both functions as "char 
*kstat_value".

Fixing this issue revealed one more set of issues:

zfs_arc.c: In function `za_read_derive':
zfs_arc.c:72: warning: control reaches end of non-void function
*** Error code 1
make: Fatal error: Command failed for target `zfs_arc_la-zfs_arc.lo'

A similar error occurred for za_read_gauge. I addressed this by adding a 
"return (0);" at the end of both functions.

I've attached a patch for the 5.1.0 version of zfs_arc.c which 
incorporates both fixes.

Thanks,
Scott Severtson
Chief Architect
Digital Measures
-------------- next part --------------
A non-text attachment was scrubbed...
Name: solaris-10-gcc-compatability.patch
Type: text/x-patch
Size: 995 bytes
Desc: not available
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20120529/31a5326a/attachment.bin>


More information about the collectd mailing list