This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/1290] New: Quality of implementation request to name anonymous enum for socket level message types
- From: "clay at google dot com" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 2 Sep 2005 22:28:54 -0000
- Subject: [Bug libc/1290] New: Quality of implementation request to name anonymous enum for socket level message types
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
There is an anonymous enum in socket.h for socket level message types which
causes problems for us under certain circumstances. Here is an small example
test case which reproduces the problem:
#include <sys/socket.h>
template <class t>
void Function(const t& v2) {
}
int main() {
Function(SCM_RIGHTS);
return 0;
}
GCC Output:
>> error: '<anonymous enum>' is/uses anonymous type
>> error: trying to instantiate 'template<class t> void Function(const t&)'
>> error: no matching function for call to 'Function(<anonymous enum>)'
What do you think of the following patch?
* sysdeps/unix/sysv/linux/bits/socket.h [_LIBC]: Provide name to
anonymous enum for socket level message types.
--- socket.h 2005-09-02 15:06:21.000000000 -0700
+++ socket_new.h 2005-09-02 15:07:48.000000000 -0700
@@ -281,7 +281,7 @@
/* Socket level message types. This must match the definitions in
<linux/socket.h>. */
-enum
+enum __socket_control_message_type
{
SCM_RIGHTS = 0x01 /* Transfer file descriptors. */
#define SCM_RIGHTS SCM_RIGHTS
Thanks,
Clay
--
Summary: Quality of implementation request to name anonymous enum
for socket level message types
Product: glibc
Version: unspecified
Status: NEW
Severity: enhancement
Priority: P2
Component: libc
AssignedTo: gotom at debian dot or dot jp
ReportedBy: clay at google dot com
CC: glibc-bugs at sources dot redhat dot com
http://sources.redhat.com/bugzilla/show_bug.cgi?id=1290
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.