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]

Re: pthread_mutex_init() with gcc-3.4.3 on Tru64 UNIX


On Sat, Jul 09, 2005 at 09:15:18AM -0400, Ishwar Rattan wrote:
> 
> 
> On Fri, 8 Jul 2005, Albert Chin wrote:
> 
> > $ uname -a
> > OSF1 [name] V4.0 878 alpha
> > $ uname -a
> > OSF1 [name] V5.1 732 alpha
> >
> > $ cat mutex.c
> > #include <stdlib.h>
> > #include <pthread.h>
> >
> > int
> > main (void) {
> >   pthread_mutex_t lck;
> >
> >   if (pthread_mutex_init(&lck, 0) != 0)
> >     exit (2);
> >   if (pthread_mutex_lock(&lck) != 0)
> >     exit (3);
> >   if (pthread_mutex_unlock(&lck) != 0)
> >     exit (4);
> >   if (pthread_mutex_destroy(&lck) != 0)
> >     exit (5);
> >
> >   exit (0);
> > }
> >
> > $ cc mutex.c
> 
> Try cc mutex.c -lpthread

I know. I'm curious why:
  $ /opt/TWWfsw/gcc343/bin/gcc mutex.c
succeeds. I'd expect it to fail, just as 'cc mutex.c' failed.

-- 
albert chin (china@thewrittenword.com)


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