This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

expected primary expression during make (seq24-0.6.3)


I'm trying to compile seq24-0.6.3 and get the following make
error. The developers of seq24 are baffled and don't know how to help
me and advised me to this list.

I'm also getting the exact same error with 0.6.2, 0.6.1 and 0.6.0.

I'm on linux-2.6.12-rc1-RT-V0.7.41-15 on a p3-600,
glibc-2.3.4-20040828 and gcc-3.4.2

mutex.cpp:24: error: expected primary-expression before '.' token
mutex.cpp:24: error: expected primary-expression before '{' token
mutex.cpp:24: error: expected `}' before '{' token
mutex.cpp:24: error: expected `,' or `;' before '{' token
mutex.cpp:24: error: expected declaration before '}' token
make[2]: *** [mutex.o] Error 1
make[2]: Leaving directory `/src/seq24-0.6.3/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/src/seq24-0.6.3/src'
make: *** [all-recursive] Error 1

The maintainer looked into the mutex.cpp source code (preprocessed
output)

line 24 is:
const pthread_mutex_t mutex::recmutex =
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;

which after preprocessing is:
const pthread_mutex_t mutex::recmutex = {0, 0, 0,
PTHREAD_MUTEX_RECURSIVE_NP, { 0, 0 }};

He said: "this sounds strange because there is no '.' token. Could you
verify this?"

I then replied with: 
gcc -E mutex.cpp gives me: 
const pthread_mutex_t mutex::recmutex = { .__data = { .__kind = PTHREAD_MUTEX_RECURSIVE_NP } };

My pthread.h file looks like this: 
http://esben-stien.name/goldenarms/pthread.h

A reply to this was: "All I can tell is your pthread.h file isn't
looking like most."

/* Mutex initializers.  */
#define PTHREAD_MUTEX_INITIALIZER \
  { }
#ifdef __USE_GNU
# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
  { .__data = { .__kind = PTHREAD_MUTEX_RECURSIVE_NP } }
# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
  { .__data = { .__kind = PTHREAD_MUTEX_ERRORCHECK_NP } }
# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
  { .__data = { .__kind = PTHREAD_MUTEX_ADAPTIVE_NP } }
#endif

He said: "I'm not even sure if that is valid code?. The above code
looks like this in my 2.3.4.20040808:"

#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
  { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
#  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
  { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
#  define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
  { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }

Any pointers on how to find out what's wrong?

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
          [sip|iax]:   e     e 
           jid:b0ef@    n     n


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]