Hey,
In a header file, we define a macro if pthread is available at configure
time, like that:
#ifdef HAVE_PTHREAD
# define LK(x) pthread_mutex_t x
#else
# defne LK(x)
#endif
When we use it, for example in a structure:
struct foo
{
int i;
LK(lock);
};
So, when pthread support is disabled, we have
struct foo
{
int i;
;
};
and suncc reports the warning:
warning: syntax error: empty member declaration
One solution would be to put the ; inside the define, and remove the ; in
the structure. But then editors are completly lost when indenting the
source code.
it seems to me that empty declarations are allowed (a semicolon is a valid
empty statement). Am I wrong ? And is there a compiler option to remove
the warning ?
Vincent Torri
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.opensolaris.org/pipermail/tools-compilers/attachments/20090814/a1fcbdd0/attachment.html>