Opened 8 months ago

Last modified 8 months ago

#68213 new defect

zmq: error: unknown type name 'clockid_t'; did you mean 'clock_id_t'

Reported by: Schamschula (Marius Schamschula) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: zmq

Description

After revision bumping zmq* I fond the following error for El Capitan (10.11) and below:

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_zmq/zmq-devel/work/libzmq-8c725093ac4b44a97e6cb64566989ef12b71986c/src/clock.cpp
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_zmq/zmq-devel/work/libzmq-8c725093ac4b44a97e6cb64566989ef12b71986c/src/clock.cpp:31:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_zmq/zmq-devel/work/libzmq-8c725093ac4b44a97e6cb64566989ef12b71986c/src/clock.hpp:48:
/opt/local/include/LegacySupport/time.h:83:27: error: unknown type name 'clockid_t'; did you mean 'clock_id_t'?
extern int clock_gettime( clockid_t clk_id, struct timespec *ts );
                          ^
/usr/include/mach/clock_types.h:53:13: note: 'clock_id_t' declared here
typedef int     clock_id_t;                     /* clock identification type */
                ^

Updating legacysupport to version 1.1 did not fix it, although there is additional clock support.

It looks similar to an issue Ryan ran into with php, that was fixed upstream: https://github.com/swoole/swoole-src/pull/1365/files

Change History (5)

comment:1 Changed 8 months ago by barracuda156

Same on 10.6.8 Rosetta.

In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_zmq/zmq-devel/work/libzmq-8c725093ac4b44a97e6cb64566989ef12b71986c/src/clock.hpp:48,
                 from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_zmq/zmq-devel/work/libzmq-8c725093ac4b44a97e6cb64566989ef12b71986c/src/clock.cpp:31:
/opt/local/include/LegacySupport/time.h:83:27: error: 'clockid_t' was not declared in this scope; did you mean 'clock_id_t'?
   83 | extern int clock_gettime( clockid_t clk_id, struct timespec *ts );
      |                           ^~~~~~~~~
      |                           clock_id_t
/opt/local/include/LegacySupport/time.h:83:45: error: expected primary-expression before 'struct'
   83 | extern int clock_gettime( clockid_t clk_id, struct timespec *ts );
      |                                             ^~~~~~
/opt/local/include/LegacySupport/time.h:83:65: error: expression list treated as compound expression in initializer [-fpermissive]
   83 | extern int clock_gettime( clockid_t clk_id, struct timespec *ts );
      |                                                                 ^
/opt/local/include/LegacySupport/time.h:84:27: error: 'clockid_t' was not declared in this scope; did you mean 'clock_id_t'?
   84 | extern int clock_getres ( clockid_t clk_id, struct timespec *ts );
      |                           ^~~~~~~~~
      |                           clock_id_t
/opt/local/include/LegacySupport/time.h:84:45: error: expected primary-expression before 'struct'
   84 | extern int clock_getres ( clockid_t clk_id, struct timespec *ts );
      |                                             ^~~~~~
/opt/local/include/LegacySupport/time.h:84:65: error: expression list treated as compound expression in initializer [-fpermissive]
   84 | extern int clock_getres ( clockid_t clk_id, struct timespec *ts );
      |                                                                 ^
cc1plus: note: unrecognized command-line option '-Wno-tautological-constant-compare' may have been intended to silence earlier diagnostics
make[2]: *** [CMakeFiles/objects.dir/src/clock.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

comment:2 in reply to:  description Changed 8 months ago by barracuda156

Replying to Schamschula:

BTW, have you reported it to zmq upstream? This looks like a genuine bug that has to be fixed.

UPD. Well, I am not sure in fact. The error refers to our legacysupport include.

Last edited 8 months ago by barracuda156 (previous) (diff)

comment:3 Changed 8 months ago by barracuda156

  1. S. Anyway, let me update the -devel port and fix the bug along.

comment:4 Changed 8 months ago by barracuda156

Got the same error now with R-webfakes:

/opt/local/bin/gcc-mp-12 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include   -DNO_CGI -DNO_FILES -DARCH_IS_BIG_ENDIAN=1 -fPIC  -pipe -Os -arch ppc  -c civetweb.c -o civetweb.o
In file included from /usr/include/sys/time.h:197,
                 from /opt/local/include/LegacySupport/sys/time.h:25,
                 from civetweb.c:371:
/opt/local/include/LegacySupport/time.h:83:27: error: unknown type name 'clockid_t'; did you mean 'clock_id_t'?
   83 | extern int clock_gettime( clockid_t clk_id, struct timespec *ts );
      |                           ^~~~~~~~~
      |                           clock_id_t
/opt/local/include/LegacySupport/time.h:84:27: error: unknown type name 'clockid_t'; did you mean 'clock_id_t'?
   84 | extern int clock_getres ( clockid_t clk_id, struct timespec *ts );
      |                           ^~~~~~~~~
      |                           clock_id_t
make: *** [civetweb.o] Error 1
ERROR: compilation failed for package ‘webfakes’

So looks like this is legacy-support fault, not zmq (even though zmq seems to have an unnecessary/harmful chunk of code which triggers the error).

comment:5 Changed 8 months ago by kencu (Ken)

zmq has their own clock_gettime() implementation to use if none is available… nothing wrong with that.

why is legacy_support using clockid_t instead of clock_id_t ? Something to look into there…which is right? Are both used in code in different projects? Why? Do we need to define both?

Chris wrote this legacysupport clock stuff, so he probably knows.

Note: See TracTickets for help on using tickets.