Subject: lib/25627: sigemptyset & sigfillset cause namespace troubles for ACE
To: None <gnats-bugs@gnats.NetBSD.org>
From: J.T. Conklin <jtc@acorntoolworks.com>
List: netbsd-bugs
Date: 05/18/2004 13:23:42
>Number:         25627
>Category:       lib
>Synopsis:       sigemptyset & sigfillset cause namespace troubles for ACE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue May 18 13:24:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     J.T. Conklin
>Release:        NetBSD 2.0_BETA
>Organization:
J.T. Conklin
>Environment:
	
	
System: NetBSD orac 2.0_BETA NetBSD 2.0_BETA (GENERIC.MP) #0: Fri May 7 20:39:51 PDT 2004 jtc@orac:/home/jtc/netbsd/NetBSD-2.0/obj/sys/arch/i386/compile/GENERIC.MP i386
Architecture: i386
Machine: i386

>Description:
The 5.4.X release of ACE (ADAPTIVE Communication Environment), a C++
framework for network programming, defines ACE_OS::sigemptyset() and
ACE_OS::sigfillset() in its OS abstraction class ACE_OS.  This results
in a compilation failure due to macro expansion in the ACE_OS class
declaration when building or using the ACE library.

Strictly speaking, ACE is in the wrong here --- POSIX/XPG allows most
functions to be implemented as macros.  In fact, earlier versions of
ACE had a conditional (ACE_HAS_SIG_MACROS) which undef'd sigemptyset,
sigfullset, among others.  It appears that this accommodation was lost
as ACE was autoconfiscated.  I'll be sending an ACE problem report to
the ACE maintainers later today.

That being said, I believe it makes sense to change sigemptyset() and
sigfillset() from macros to inline functions like the other signal set
manipulation operations.  This avoids issues with the macros tromping
over the namespace for other programs/libraries, costs nothing since
gcc is used for all NetBSD targets, and should result in better debug
information being emitted.

>How-To-Repeat:
	
>Fix:
Index: signal.h
===================================================================
RCS file: /cvsroot/src/include/signal.h,v
retrieving revision 1.36
diff -c -r1.36 signal.h
*** signal.h	12 Sep 2003 20:27:50 -0000	1.36
--- signal.h	18 May 2004 13:19:21 -0000
***************
*** 134,144 ****
  	}
  	return (__sigismember(set, signo));
  }
- #endif /* __GNUC__ && __STDC__ */
  
! /* List definitions after function declarations, or Reiser cpp gets upset. */
! #define	sigemptyset(set)	(__sigemptyset(set), /*LINTED*/0)
! #define	sigfillset(set)		(__sigfillset(set), /*LINTED*/ 0)
  #endif /* !__LIBC12_SOURCE__ */
  
  /*
--- 134,154 ----
  	}
  	return (__sigismember(set, signo));
  }
  
! extern __inline int
! sigemptyset(sigset_t *set)
! {
! 	__sigemptyset(set);
! 	return (0);
! }
! 
! extern __inline int
! sigfillset(sigset_t *set)
! {
! 	__sigfillset(set);
! 	return (0);
! }
! #endif /* __GNUC__ && __STDC__ */
  #endif /* !__LIBC12_SOURCE__ */
  
  /*

>Release-Note:
>Audit-Trail:
>Unformatted: