Solaris 10 Sun Studio 12 & memcached 1.2.2

Trond Norbye Trond.Norbye at Sun.COM
Tue Jun 19 20:35:29 UTC 2007

William Pool wrote:

I was able to use the Sun Studio compiler by making the following changes:

memcached.h line 105:
I am no expert on this, but I _thought_ that if you specified a constant 
expression for the array size, it had to be a value greater than zero. 
Someone with more detailed knowledge may provide a better answer to 
this. What I did was just to increase the array size to one. I have not 
_analyzed_ the use of this variable, but my guess after a quick look is 
that it is just used to calculate an offset.

<     void * end[0];
 >     void * end[1];

You get some compiler warnings for not including signal.h, but the 
compilation errors comes from the inline keyword added to 
process_stats_detail. If my memory is correct you cannot call static 
functions from an inlined function with non-static linkage. If you make 
process_stats_detail static it will compile and link

 > #include <signal.h>
< inline void process_stats_detail(conn *c, const char *command) {
 > static inline void process_stats_detail(conn *c, const char *command) {

With these modifications I was able to compile and link the source.

I would be great if someone could correct me if my memory is wrong.. It 
may be an obsolete cache entry ;-)

Trond Norbye

More information about the memcached mailing list