Mail Archives: pgcc/1998/09/15/23:10:14
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 -