public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "brechtsanders at users dot sourceforge.net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/97484] New: typedef conflict for "byte" in GCC11 for MinGW-w64
Date: Mon, 19 Oct 2020 06:27:46 +0000	[thread overview]
Message-ID: <bug-97484-4@http.gcc.gnu.org/bugzilla/> (raw)

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;
      |                         ^~~~

             reply	other threads:[~2020-10-19  6:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19  6:27 brechtsanders at users dot sourceforge.net [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-97484-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).