public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/28182] New: _TIME_BITS=64 in C++ has issues with fcntl and ioctl
@ 2021-08-03 17:34 gerbilsoft at gerbilsoft dot com
  2021-08-04  3:56 ` [Bug libc/28182] _TIME_BITS=64 in C++ has issues with fcntl, ioctl, prctl fweimer at redhat dot com
  2021-08-06 14:44 ` fweimer at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: gerbilsoft at gerbilsoft dot com @ 2021-08-03 17:34 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28182

            Bug ID: 28182
           Summary: _TIME_BITS=64 in C++ has issues with fcntl and ioctl
           Product: glibc
           Version: 2.34
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: gerbilsoft at gerbilsoft dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Attempting to compile a 32-bit C++ program that uses fcntl.h or sys/ioctl.h if
_TIME_BITS=64 results in an error related to exception handling.

Sample code:

#include <fcntl.h>

int main(void)
{
        return 0;
}

Compile with: g++ -m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE -D_TIME_BITS=64 -c test.cpp

Results:

In file included from /usr/include/features.h:488,
                 from /usr/include/fcntl.h:25,
                 from test.cpp:1:
/usr/include/fcntl.h:191:41: error: expected initializer before ‘noexcept’
  191 |                        __fcntl_time64)  __THROW;
      |                                         ^~~~~~~
/usr/include/fcntl.h:193:41: error: expected initializer before ‘noexcept’
  193 |                        __fcntl_time64)  __THROW;
      |                                         ^~~~~~~

The same code does compile if built as C code instead of as C++.

Software versions:

OS: Gentoo Linux
Arch: amd64 (Intel Core i7-3520M)
Compiler: gcc-11.1.0
glibc: 2.34

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-06 14:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 17:34 [Bug libc/28182] New: _TIME_BITS=64 in C++ has issues with fcntl and ioctl gerbilsoft at gerbilsoft dot com
2021-08-04  3:56 ` [Bug libc/28182] _TIME_BITS=64 in C++ has issues with fcntl, ioctl, prctl fweimer at redhat dot com
2021-08-06 14:44 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).