Re: [MacPorts] #67921: xinit fails on 10.6 due to gcc-4.2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘read_source_group’

MacPorts noreply at macports.org
Sun Aug 6 18:25:48 UTC 2023


#67921: xinit fails on 10.6 due to gcc-4.2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘read_source_group’
---------------------------+----------------------------------
  Reporter:  barracuda156  |      Owner:  jeremyhu
      Type:  defect        |     Status:  assigned
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:  2.8.1
Resolution:                |   Keywords:  snowleopard, leopard
      Port:  xinit         |
---------------------------+----------------------------------

Comment (by barracuda156):

 Oh well, it fails on 10.6 when built for `ppc` even with `gcc12`, because
 tries to use `libdispatch`. I will deal with this.

 {{{
 /usr/bin/make  all-am
 make[4]: Entering directory
 `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_x11_xinit/xinit/work/xinit-1.4.1/launchd/privileged_startx'
 /opt/local/bin/gcc-mp-12 -DHAVE_CONFIG_H -I. -I../..  -I./..
 -DXINITDIR=\"/opt/local/etc/X11/xinit\"
 -DSCRIPTDIR=\"/opt/local/etc/X11/xinit/privileged_startx.d\"
 -DBINDIR=\"/opt/local/bin\" -I/opt/local/include  -pipe -Os -arch ppc -MT
 console_redirect.o -MD -MP -MF .deps/console_redirect.Tpo -c -o
 console_redirect.o `test -f './../console_redirect.c' || echo
 './'`./../console_redirect.c
 /opt/local/bin/gcc-mp-12 -DHAVE_CONFIG_H -I. -I../..  -I./..
 -DXINITDIR=\"/opt/local/etc/X11/xinit\"
 -DSCRIPTDIR=\"/opt/local/etc/X11/xinit/privileged_startx.d\"
 -DBINDIR=\"/opt/local/bin\" -I/opt/local/include  -pipe -Os -arch ppc -MT
 server.o -MD -MP -MF .deps/server.Tpo -c -o server.o server.c
 In file included from /usr/include/dispatch/dispatch.h:59,
                  from ./../console_redirect.c:52:
 /usr/include/dispatch/core.h:199:15: error: expected identifier or '('
 before '^' token
   199 | typedef void (^dispatch_block_t)(void);
       |               ^
 /usr/include/dispatch/core.h:236:40: error: unknown type name
 'dispatch_block_t'; did you mean 'dispatch_queue_t'?
   236 | dispatch_async(dispatch_queue_t queue, dispatch_block_t block);
       |                                        ^~~~~~~~~~~~~~~~
       |                                        dispatch_queue_t
 /usr/include/dispatch/core.h:265:39: error: unknown type name
 'dispatch_block_t'; did you mean 'dispatch_queue_t'?
   265 | dispatch_sync(dispatch_queue_t queue, dispatch_block_t block);
       |                                       ^~~~~~~~~~~~~~~~
       |                                       dispatch_queue_t
 /usr/include/dispatch/core.h:293:65: error: expected ')' before '^' token
   293 | dispatch_apply(dispatch_queue_t queue, size_t iterations, void
 (^block)(size_t));
       |                                                                 ^
       |                                                                 )
 In file included from /usr/include/dispatch/dispatch.h:60:
 /usr/include/dispatch/events.h:104:15: error: expected identifier or '('
 before '^' token
   104 | typedef void (^dispatch_event_handler_t)(dispatch_event_t event);
       |               ^
 /usr/include/dispatch/events.h:112:15: error: expected identifier or '('
 before '^' token
   112 | typedef void (^dispatch_source_finalizer_t)(dispatch_source_t
 source);
       |               ^
 /usr/include/dispatch/events.h:529:9: error: unknown type name
 'dispatch_source_finalizer_t'; did you mean 'dispatch_source_attr_t'?
   529 |         dispatch_source_finalizer_t finalizer);
       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
       |         dispatch_source_attr_t
 /usr/include/dispatch/events.h:610:9: error: unknown type name
 'dispatch_event_handler_t'; did you mean 'dispatch_event_t'?
   610 |         dispatch_event_handler_t handler);
       |         ^~~~~~~~~~~~~~~~~~~~~~~~
       |         dispatch_event_t
 /usr/include/dispatch/events.h:660:9: error: unknown type name
 'dispatch_event_handler_t'; did you mean 'dispatch_event_t'?
   660 |         dispatch_event_handler_t handler);
       |         ^~~~~~~~~~~~~~~~~~~~~~~~
       |         dispatch_event_t
 /usr/include/dispatch/events.h:776:9: error: unknown type name
 'dispatch_event_handler_t'; did you mean 'dispatch_event_t'?
   776 |         dispatch_event_handler_t handler);
       |         ^~~~~~~~~~~~~~~~~~~~~~~~
       |         dispatch_event_t
 /usr/include/dispatch/events.h:821:9: error: unknown type name
 'dispatch_event_handler_t'; did you mean 'dispatch_event_t'?
   821 |         dispatch_event_handler_t handler);
       |         ^~~~~~~~~~~~~~~~~~~~~~~~
       |         dispatch_event_t
 /usr/include/dispatch/events.h:909:9: error: unknown type name
 'dispatch_event_handler_t'; did you mean 'dispatch_event_t'?
   909 |         dispatch_event_handler_t handler);
       |         ^~~~~~~~~~~~~~~~~~~~~~~~
       |         dispatch_event_t
 /usr/include/dispatch/events.h:985:9: error: unknown type name
 'dispatch_event_handler_t'; did you mean 'dispatch_event_t'?
   985 |         dispatch_event_handler_t handler);
       |         ^~~~~~~~~~~~~~~~~~~~~~~~
       |         dispatch_event_t
 /usr/include/dispatch/events.h:1056:9: error: unknown type name
 'dispatch_event_handler_t'; did you mean 'dispatch_event_t'?
  1056 |         dispatch_event_handler_t handler);
       |         ^~~~~~~~~~~~~~~~~~~~~~~~
       |         dispatch_event_t
 ./../console_redirect.c:55:8: error: unknown type name 'dispatch_group_t'
    55 | static dispatch_group_t read_source_group;
       |        ^~~~~~~~~~~~~~~~
 ./../console_redirect.c: In function 'read_from_source':
 ./../console_redirect.c:146:14: warning: implicit declaration of function
 'dispatch_source_get_handle'; did you mean 'dispatch_source_get_pid'?
 [-Wimplicit-function-declaration]
   146 |     int fd = dispatch_source_get_handle(source);
       |              ^~~~~~~~~~~~~~~~~~~~~~~~~~
       |              dispatch_source_get_pid
 ./../console_redirect.c: In function 'cancel_source':
 ./../console_redirect.c:163:5: warning: implicit declaration of function
 'dispatch_release'; did you mean 'dispatch_main'? [-Wimplicit-function-
 declaration]
   163 |     dispatch_release(source);
       |     ^~~~~~~~~~~~~~~~
       |     dispatch_main
 ./../console_redirect.c:164:5: warning: implicit declaration of function
 'dispatch_group_leave'; did you mean 'dispatch_queue_release'?
 [-Wimplicit-function-declaration]
   164 |     dispatch_group_leave(read_source_group);
       |     ^~~~~~~~~~~~~~~~~~~~
       |     dispatch_queue_release
 ./../console_redirect.c: In function 'redirect_atexit':
 ./../console_redirect.c:246:9: warning: implicit declaration of function
 'dispatch_group_wait' [-Wimplicit-function-declaration]
   246 |         dispatch_group_wait(read_source_group,
 dispatch_time(DISPATCH_TIME_NOW, 3LL * NSEC_PER_SEC));
       |         ^~~~~~~~~~~~~~~~~~~
 ./../console_redirect.c:246:48: warning: implicit declaration of function
 'dispatch_time'; did you mean 'dispatch_main'? [-Wimplicit-function-
 declaration]
   246 |         dispatch_group_wait(read_source_group,
 dispatch_time(DISPATCH_TIME_NOW, 3LL * NSEC_PER_SEC));
       |                                                ^~~~~~~~~~~~~
       |                                                dispatch_main
 ./../console_redirect.c:246:62: error: 'DISPATCH_TIME_NOW' undeclared
 (first use in this function); did you mean 'DISPATCH_TIMER_ONESHOT'?
   246 |         dispatch_group_wait(read_source_group,
 dispatch_time(DISPATCH_TIME_NOW, 3LL * NSEC_PER_SEC));
       |
 ^~~~~~~~~~~~~~~~~
       |
 DISPATCH_TIMER_ONESHOT
 ./../console_redirect.c:246:62: note: each undeclared identifier is
 reported only once for each function it appears in
 ./../console_redirect.c:246:87: error: 'NSEC_PER_SEC' undeclared (first
 use in this function)
   246 |         dispatch_group_wait(read_source_group,
 dispatch_time(DISPATCH_TIME_NOW, 3LL * NSEC_PER_SEC));
       |
 ^~~~~~~~~~~~
 ./../console_redirect.c: In function 'xi_asl_init':
 ./../console_redirect.c:274:25: warning: implicit declaration of function
 'dispatch_group_create'; did you mean 'dispatch_queue_create'?
 [-Wimplicit-function-declaration]
   274 |     read_source_group = dispatch_group_create();
       |                         ^~~~~~~~~~~~~~~~~~~~~
       |                         dispatch_queue_create
 In file included from ./../console_redirect.c:36:
 ./../console_redirect.c:275:30: warning: comparison between pointer and
 integer
   275 |     assert(read_source_group != NULL);
       |                              ^~
 ./../console_redirect.c: In function 'xi_asl_log_fd':
 ./../console_redirect.c:286:13: error: expected '=', ',', ';', 'asm' or
 '__attribute__' before '__block'
   286 |     int err __block = 0;
       |             ^~~~~~~
 ./../console_redirect.c:286:13: error: '__block' undeclared (first use in
 this function); did you mean 'flock'?
   286 |     int err __block = 0;
       |             ^~~~~~~
       |             flock
 ./../console_redirect.c:287:12: error: unknown type name 'dispatch_once_t'
   287 |     static dispatch_once_t once_control;
       |            ^~~~~~~~~~~~~~~
 ./../console_redirect.c:288:5: warning: implicit declaration of function
 'dispatch_once_f' [-Wimplicit-function-declaration]
   288 |     dispatch_once_f(&once_control, NULL, xi_asl_init);
       |     ^~~~~~~~~~~~~~~
 ./../console_redirect.c:300:5: warning: implicit declaration of function
 'dispatch_sync'; did you mean 'dispatch_main'? [-Wimplicit-function-
 declaration]
   300 |     dispatch_sync(redirect_serial_q, ^
       |     ^~~~~~~~~~~~~
       |     dispatch_main
 ./../console_redirect.c:300:38: error: expected expression before '^'
 token
   300 |     dispatch_sync(redirect_serial_q, ^
       |                                      ^
 ./../console_redirect.c:368:12: error: 'err' undeclared (first use in this
 function)
   368 |     return err;
       |            ^~~
 make[4]: *** [console_redirect.o] Error 1
 make[4]: *** Waiting for unfinished jobs....
 mv -f .deps/server.Tpo .deps/server.Po
 }}}

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


More information about the macports-tickets mailing list