[MacPorts] #72326: gcc14: unable to compile iostream

MacPorts noreply at macports.org
Fri Apr 11 10:27:35 UTC 2025


#72326: gcc14: unable to compile iostream
-----------------------+--------------------
 Reporter:  fvanmaele  |      Owner:  (none)
     Type:  defect     |     Status:  new
 Priority:  Normal     |  Milestone:
Component:  ports      |    Version:  2.10.5
 Keywords:             |       Port:
-----------------------+--------------------
 Compiling a Hello World program with gcc14 results in the following error:
 {{{
 % g++-mp-14 hello.cpp
 In file included from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/machine/_structs.h:35,
                  from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/arm/_mcontext.h:36,
                  from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/machine/_mcontext.h:34,
                  from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/sys/signal.h:146,
                  from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/sys/wait.h:109,
                  from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/_stdlib.h:70,
                  from
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/stdlib.h:58,
                  from /opt/local/include/gcc14/c++/cstdlib:79,
                  from
 /opt/local/include/gcc14/c++/ext/string_conversions.h:43,
                  from
 /opt/local/include/gcc14/c++/bits/basic_string.h:4154,
                  from /opt/local/include/gcc14/c++/string:54,
                  from
 /opt/local/include/gcc14/c++/bits/locale_classes.h:40,
                  from /opt/local/include/gcc14/c++/bits/ios_base.h:41,
                  from /opt/local/include/gcc14/c++/ios:44,
                  from /opt/local/include/gcc14/c++/ostream:40,
                  from /opt/local/include/gcc14/c++/iostream:41,
                  from hello.cpp:1:
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:627:35:
 error: expected primary-expression before 'unsigned'
   627 | } __attribute__((aligned(_Alignof(unsigned int))));
       |                                   ^~~~~~~~
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:627:26:
 error: '_Alignof' was not declared in this scope
   627 | } __attribute__((aligned(_Alignof(unsigned int))));
       |                          ^~~~~~~~
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:633:35:
 error: expected primary-expression before 'unsigned'
   633 | } __attribute__((aligned(_Alignof(unsigned int))));
       |                                   ^~~~~~~~
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:633:26:
 error: '_Alignof' was not declared in this scope
   633 | } __attribute__((aligned(_Alignof(unsigned int))));
       |                          ^~~~~~~~
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:639:35:
 error: expected primary-expression before 'unsigned'
   639 | } __attribute__((aligned(_Alignof(unsigned int))));
       |                                   ^~~~~~~~
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:639:26:
 error: '_Alignof' was not declared in this scope
   639 | } __attribute__((aligned(_Alignof(unsigned int))));
       |                          ^~~~~~~~
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:645:35:
 error: expected primary-expression before 'unsigned'
   645 | } __attribute__((aligned(_Alignof(unsigned int))));
       |                                   ^~~~~~~~
 /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/include/mach/arm/_structs.h:645:26:
 error: '_Alignof' was not declared in this scope
   645 | } __attribute__((aligned(_Alignof(unsigned int))));
       |                          ^
 }}}
 hello.cpp:
 {{{
 #include <iostream>

 int main() {
   std::cout << "Hello" << std::endl;
 }
 }}}
 clang 17.0 provided from xcode on Sequoia 15.4 works as intended.

-- 
Ticket URL: <https://trac.macports.org/ticket/72326>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list