[Bug libstdc++/91655] New: Use of `__in` and `__out` as argument names in c++ headers

sagebar at web dot de gcc-bugzilla@gcc.gnu.org
Wed Sep 4 09:20:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91655

            Bug ID: 91655
           Summary: Use of `__in` and `__out` as argument names in c++
                    headers
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sagebar at web dot de
  Target Milestone: ---

After building libstdc++ for a custom toolchain that tries to form a hybrid of
both linux/gnu system headers, as well as headers normally only found on MSVC
(in this case namely: <sal.h>), I've noticed a problem when it comes to some of
the names used for paramters taken/used by functions exposed in headers created
by libstdc++

Example:
In
[`bits/basic_string.tcc`](https://gcc.gnu.org/onlinedocs/gcc-4.6.2/libstdc++/api/a00771_source.html),
a function is defined `[...] operator>>(basic_istream<_CharT, _Traits>& __in,
[...])`
As plainly visible, this function takes (and uses) an argument named `__in`.
This causes a collision with a macro defined by MSVC's
[`<sal.h>`](https://github.com/dotnet/corert/blob/master/src/Native/inc/unix/sal.h)
header, which is also used by headers such as `<Windows.h>`.

I bring up this minor compatibility problem not because it posed too much
problems for me (for my purposes, I simply created a
[patch](https://github.com/GrieferAtWork/KOSmk4/blob/master/kos/misc/patches/libstdc%2B%2B-9.1.0.patch)
file to fix all of those argument names), but because the fix would be so
simple that resolving it could possibly take less time than reading this bug
report.

Of course you are still free to mark this as wont-fix and I would fully
understand the decision to not provide for such compatibility with a
proprietary Windows header.


More information about the Gcc-bugs mailing list