[MacPorts] #69632: gcc10-bootstrap does not work on 14.4.1: error: missing ')' after "__has_attribute"

MacPorts noreply at macports.org
Tue May 14 22:26:42 UTC 2024


#69632: gcc10-bootstrap does not work on 14.4.1: error: missing ')' after
"__has_attribute"
------------------------------+----------------------
  Reporter:  barracuda156     |      Owner:  catap
      Type:  defect           |     Status:  assigned
  Priority:  Normal           |  Milestone:
 Component:  ports            |    Version:  2.9.1
Resolution:                   |   Keywords:  sonoma
      Port:  gcc10-bootstrap  |
------------------------------+----------------------
Changes (by ryandesign):

 * cc: cquike (added)


Comment:

 Replying to [comment:7 barracuda156]:
 > Replying to [comment:4 ryandesign]:
 > > In the forum thread, it says gcc 11, 12, and 13 don't have this
 problem, so maybe it was a gcc bug that was already fixed. Try a newer
 gcc.
 >
 > Well, trying a newer gcc is not a solution here, since this is the only
 bootstrap gcc version we got.

 Sure it is. You are experiencing a bug that was fixed in a later version
 of gcc than the one you are using. The solution is to use the newer
 version of gcc. We have a gcc11 port. If that's not satisfactory and you
 need it to be a "bootstrap" version, then create a gcc11-bootstrap (or
 newer) port.

 Replying to [comment:8 catap]:
 > pointed commit won't be complicated to backport.

 I'm not wild about backporting more and more bug fixes to older compilers.
 At some point, gcc 10 with a bunch of patches can no longer be considered
 gcc 10. If you want gcc 10, bugs and all, then use gcc 10. If you don't
 want the bugs that were fixed in newer versions, then use the newer
 versions.

 Replying to [comment:11 cquike]:
 > I have a (maybe) related problem. This is with gcc-13 actually but the
 error message is the same:
 >
 > {{{
 > $ cat test.c
 > #include <stdio.h>
 > $ /opt/local/bin/gcc-mp-13
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk  -std=c99
 -c test.c
 > In file included from
 /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/_stdio.h:68,
 >                  from
 /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/stdio.h:64,
 >                  from j.c:1:
 >
 /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30:
 error: missing ')' after "__has_attribute"
 >   554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
 >       |                              ^
 >
 /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31:
 error:  ':' without preceding '?'
 >   554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
 > }}}
 >
 > It seems that the -std=c99 flag is crucial to get the error. Omitting it
 does not cause the error. Has anyone any workaround for this problem?

 Then evidently gcc in C99 mode is not compatible with macOS 14 headers.
 Your options are not to use C99 mode or not to use gcc.

-- 
Ticket URL: <https://trac.macports.org/ticket/69632#comment:12>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list