Bug 264297 - _POSIX_C_SOURCE=200809L causes failure in #include <sstream>
Summary: _POSIX_C_SOURCE=200809L causes failure in #include <sstream>
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: 13.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-standards (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-27 20:19 UTC by Yuri Victorovich
Modified: 2022-05-27 20:23 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2022-05-27 20:19:37 UTC
This code:
> #define _POSIX_C_SOURCE 200809L
> #include <sstream>

fails:

$ c++ x.cpp 
In file included from x.cpp:3:
In file included from /usr/include/c++/v1/sstream:184:
In file included from /usr/include/c++/v1/istream:163:
In file included from /usr/include/c++/v1/ostream:138:
In file included from /usr/include/c++/v1/ios:214:
/usr/include/c++/v1/__locale:637:16: error: use of undeclared identifier 'isascii'
        return isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) !=0 : false;
               ^
/usr/include/c++/v1/__locale:644:22: error: use of undeclared identifier 'isascii'
            *__vec = isascii(*__low) ? __tab_[static_cast<int>(*__low)] : 0;
                     ^
/usr/include/c++/v1/__locale:652:17: error: use of undeclared identifier 'isascii'
            if (isascii(*__low) && (__tab_[static_cast<int>(*__low)] & __m))
                ^
/usr/include/c++/v1/__locale:661:19: error: use of undeclared identifier 'isascii'
            if (!(isascii(*__low) && (__tab_[static_cast<int>(*__low)] & __m)))
                  ^
4 errors generated.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2022-05-27 20:20:15 UTC
The problem occurs in the port audio/jalv when patches are removed.
Comment 2 Warner Losh freebsd_committer freebsd_triage 2022-05-27 20:23:21 UTC
Defining _POSIX_C_SOURCE for C++ isn't well defined since C++ is out of scope for the POSIX standard.

What's the usual thing that other systems do?