[MacPorts] #74210: spice-gtk fails to build with C23: error: 'for' loop initial declarations are only allowed in C99 or C11 mode

MacPorts noreply at macports.org
Mon Jul 13 03:30:07 UTC 2026


#74210: spice-gtk fails to build with C23: error: 'for' loop initial declarations
are only allowed in C99 or C11 mode
---------------------------+--------------------
  Reporter:  barracuda156  |      Owner:  (none)
      Type:  defect        |     Status:  new
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:  2.12.5
Resolution:                |   Keywords:
      Port:  spice-gtk     |
---------------------------+--------------------

Comment (by ryandesign):

 You are using MacPorts gcc16 but [ticket:73925 no such port exists]?

 And you are suggesting that declaring a `for` loop variable in the `for`
 loop, which was not allowed in C89 and became allowed in C99, is now once
 again not allowed in C23? That would break a ton of code, so I'm
 suspicious of that claim.

 I was able to compile this test program:

 {{{#!c
 #include <stdio.h>
 int main(void)
 {
         for (int i = 0; i < 4; ++i)
         {
                 printf("%d\n", i);
         }
         return 0;
 }
 }}}

 using both gcc-mp-15 and clang-mp-18 on Lion in C23 mode:

 {{{
 $ gcc-mp-18 -std=c23 test.c -o test
 $ ./test
 0
 1
 2
 3
 $ clang-mp-18 -std=c23 test.c -o test
 $ ./test
 0
 1
 2
 3
 $
 }}}

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


More information about the macports-tickets mailing list