delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1998/09/15/23:10:14

X-pop3-spooler: POP3MAIL 2.1.0 b 4 980420 -bs-
Message-Id: <199809152308.SAA07982@tango.cs.wustl.edu>
To: Marc Lehmann <pcg AT goof DOT com>, ace-users AT cs DOT wustl DOT edu
cc: Jason Ahrens <jahrens AT magma DOT ca>, pgcc-list AT Desk DOT nl
Subject: Re: Unknown error
In-reply-to: Your message of "Wed, 16 Sep 1998 00:43:07 +0200."
<19980916004307 DOT 61925 AT cerebro DOT laendle>
Date: Tue, 15 Sep 1998 18:08:53 -0500
From: "Douglas C. Schmidt" <schmidt AT cs DOT wustl DOT edu>
Sender: Marc Lehmann <pcg AT goof DOT com>
Status: RO
X-Status: A
Lines: 69

Hi Marc,

> While this is definitely a compiler bug, it may be caused by a
> "buggy" source (egcs/pgcc follows the current c++ standard much
> better than most everything else).  Also, the code uses a symbol
> (semun) not specified by any standard.

Right, good point.

> BTW, the code is probably the cleanest c++ code I saw since a long time, so
> after fixing the semun problem, the code compiled. I'd recommend upgrading
> to pgcc-1.1, which is much more stable (and implements most of C++ ;)
> 
> --- ./ace/OS.h.old	Tue Sep 15 23:16:32 1998
> +++ ./ace/OS.h	Tue Sep 15 23:20:44 1998
> @@ -3032,6 +3032,15 @@
>  #include /**/ <sys/ipc.h>
>  #include /**/ <sys/shm.h>
>  #include /**/ <sys/sem.h>
> +#if defined(__GLIBC__) && defined(_SEM_SEMUN_UNDEFINED)
> +  union semun
> +  {
> +    int val;
> +    struct semid_ds *buf;
> +    unsigned short int *array;
> +    struct seminfo *__buf;
> +  };
> +#endif
>  #include /**/ <sys/file.h>
>  #include /**/ <sys/time.h>
>  #include /**/ <sys/resource.h>

I think there's a better fix here that's already in the ACE code.
Please search for the ACE_HAS_SEMUN flag in OS.h and you'll see the
following:

# if !defined (ACE_HAS_SEMUN)
union semun
{
  int val; // value for SETVAL
  struct semid_ds *buf; // buffer for IPC_STAT & IPC_SET
  u_short *array; // array for GETALL & SETALL
};
# endif /* !ACE_HAS_SEMUN */

What we probably need to do is make sure that ACE_HAS_SEMUN is not
defined in the config.h file that you're trying to use (can you
please give me more information on which compiler/platform this is?).
Or, we could make the #ifdef more sophisticated, i.e.

# if !defined (ACE_HAS_SEMUN) || (defined(__GLIBC__) && defined(_SEM_SEMUN_UNDEFINED))
union semun
{
  int val; // value for SETVAL
  struct semid_ds *buf; // buffer for IPC_STAT & IPC_SET
  u_short *array; // array for GETALL & SETALL
};
# endif /* !ACE_HAS_SEMUN */

Please let me know which is better.  

BTW, Ossama, this is something we should make sure to check for in the
autoconf stuff, if it's not already there.

thanks,

        Doug


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019