public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97484] New: typedef conflict for "byte" in GCC11 for MinGW-w64
@ 2020-10-19  6:27 brechtsanders at users dot sourceforge.net
  2020-10-19  8:04 ` [Bug libstdc++/97484] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: brechtsanders at users dot sourceforge.net @ 2020-10-19  6:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97484
           Summary: typedef conflict for "byte" in GCC11 for MinGW-w64
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: brechtsanders at users dot sourceforge.net
  Target Milestone: ---

I just built GCC11 snapshot 20201011 for the MinGW-w64 platform and noticed
that some things won't build with it because "byte" now has conflicting
definitions.
Windows seems to already define this in rpcndr.h, which is included from
windows.h.
But it's also defined in C++' cpp_type_traits.

The errors below are from an attempt to compile Ninja with GCC11 snapshot
20201011.

These issues were not present with GCC 11 or lower.

In file included from
d:\prog\winlibs32_stage\mingw32\i686-w64-mingw32\include\wtypes.h:8,
                 from
d:\prog\winlibs32_stage\mingw32\i686-w64-mingw32\include\winscard.h:10,
                 from
d:\prog\winlibs32_stage\mingw32\i686-w64-mingw32\include\windows.h:97,
                 from .\src\disk_interface.cc:27:
d:\prog\winlibs32_stage\mingw32\i686-w64-mingw32\include\rpcndr.h:64:11: error:
reference to 'byte' is ambiguous
   64 |   typedef byte cs_byte;
      |           ^~~~
In file included from
d:\prog\winlibs32_stage\mingw32\include\c++\11.0.0\bits\stl_algobase.h:61,
                 from
d:\prog\winlibs32_stage\mingw32\include\c++\11.0.0\bits\stl_tree.h:63,
                 from
d:\prog\winlibs32_stage\mingw32\include\c++\11.0.0\map:60,
                 from .\src\disk_interface.h:18,
                 from .\src\disk_interface.cc:15:
d:\prog\winlibs32_stage\mingw32\include\c++\11.0.0\bits\cpp_type_traits.h:404:30:
note: candidates are: 'enum class std::byte'
  404 |   enum class byte : unsigned char;
      |                              ^~~~
In file included from
d:\prog\winlibs32_stage\mingw32\i686-w64-mingw32\include\wtypes.h:8,
                 from
d:\prog\winlibs32_stage\mingw32\i686-w64-mingw32\include\winscard.h:10,
                 from
d:\prog\winlibs32_stage\mingw32\i686-w64-mingw32\include\windows.h:97,
                 from .\src\disk_interface.cc:27:
d:\prog\winlibs32_stage\mingw32\i686-w64-mingw32\include\rpcndr.h:63:25: note: 
               'typedef unsigned char byte'
   63 |   typedef unsigned char byte;
      |                         ^~~~

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

end of thread, other threads:[~2023-03-14 21:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19  6:27 [Bug c++/97484] New: typedef conflict for "byte" in GCC11 for MinGW-w64 brechtsanders at users dot sourceforge.net
2020-10-19  8:04 ` [Bug libstdc++/97484] " rguenth at gcc dot gnu.org
2020-10-19  8:26 ` jakub at gcc dot gnu.org
2020-10-19  9:39 ` brechtsanders at users dot sourceforge.net
2020-10-19  9:45 ` jakub at gcc dot gnu.org
2020-10-19 10:09 ` brechtsanders at users dot sourceforge.net
2020-10-19 10:20 ` jakub at gcc dot gnu.org
2023-03-14 21:13 ` Abderraouf.bousri at g dot enp.edu.dz

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).