views:

175

answers:

2

When attempting to compile mpd with Sun Studio compiler:

"client.c", line 438: warning: implicit function declaration: typeof

I tracked down the offending lines of code, in dlist.h:

#define list_for_each_entry(pos, head, member)                          \
        for (pos = list_entry((head)->next, typeof(*pos), member);      \
             &pos->member != (head);    \
             pos = list_entry(pos->member.next, typeof(*pos), member))

According to typeof Wikipedia article, it's a GCC extension. Is there a typeof equivalent in Sun Studio, or a way to emulate it?

+3  A: 

This article says typeof is introduced in Sun Studio 12.

laalto
A: 

Prove with

#include <stddef.h>

in Sun Studio 12 work

Lear