Ubuntu

declaration of ‘mqd_t mq_open(const char*, int, ...)’ throws different exceptions

Reported by luca on 2010-05-17
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GLibC
New
Undecided
Unassigned
eglibc
New
Undecided
Unassigned
glibc (Debian)
Fix Released
Unknown
glibc (Ubuntu)
Undecided
Unassigned

Bug Description

I'm getting a weird error when compiling a trivial test using mq_open(), when using both -pedantic and -O2:

$ cat mqtest.cpp
#include <mqueue.h>
int main()
{
        mq_open("/tmp/test", O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR, 0);
        return 0;
}
$ g++ -pedantic -O2 -c mqtest.cpp
In file included from /usr/include/mqueue.h:97,
                 from mqtest.cpp:2:
/usr/include/bits/mqueue2.h: In function ‘mqd_t mq_open(const char*, int, ...)’:
/usr/include/bits/mqueue2.h:37: error: declaration of ‘mqd_t mq_open(const char*, int, ...)’ throws different exceptions
/usr/include/bits/mqueue2.h:26: error: from previous declaration ‘mqd_t mq_open(const char*, int, ...) throw ()’

Using just -O2 or just -pedantic works fine:
$ g++ -O2 -c mqtest.cpp
$ g++ -pedantic -c mqtest.cpp
$

Using a Debian unstable system to compile, works fine with both -O2 -pedantic at the same time.

Ubuntu 10.4, x86_64, libc6-dev 2.11.1-0ubuntu7, g++ 4:4.4.3-1ubuntu1

luca (llucax) on 2010-05-17
description: updated
luca (llucax) on 2010-05-17
description: updated
luca (llucax) wrote :

Is this so hard to fix? Is really annoying to have to change the compilation options when I have to compile in Ubuntu. Seems like a very silly error, but a very annoying one.

luca (llucax) wrote :

The difference between Debian and Ubuntu is Ubuntu defines the macro _FORTIFY_SOURCE, but I can't see where (and that triggers the inclusion of bits/mqueue2.h). I think bits/mqueue2.h is broken in both though.

luca (llucax) wrote :

The problem is explained in more detail in the Debian bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=595380

Changed in glibc (Debian):
status: Unknown → Confirmed
Changed in glibc (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.