signalwire / freeswitch

FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
https://freeswitch.com/#getting-started
Other
3.56k stars 1.41k forks source link

switch_core.c:3569:67: error: a function declaration without a prototype is deprecated in all versions of C #2017

Closed MarioG-X closed 1 year ago

MarioG-X commented 1 year ago

Describe the bug The C language deprecated some syntax and elements over the years. Some FreeSwitch code contains deprecated items that until recently, was allowed to compile. Recent C/C++ compilers are now disallowing the oldest deprecated code, and from what I found on the web, this started in 2020 and is going to get worse with the next compiler releases.

This is on an Intel Mac so it is not related to Apple Silicon.

Starting with the current Xcode/Command Line Tools 14.3, this deprecated code is no longer allowed to compile as a warning, but is now an error. So make now fails with the messages below. I tried: ./configure cxxflags='-Wno-strict-prototypes' but it made no difference.

  CC       src/libfreeswitch_la-switch_core.lo
src/switch_core.c:3569:67: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_start_port()
                                                                  ^
                                                                   void
src/switch_core.c:3580:65: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_end_port()
                                                                ^
                                                                 void
2 errors generated.
make[1]: *** [src/libfreeswitch_la-switch_core.lo] Error 1

To Reproduce Download master, bootstrap, config, make

Expected behavior Make success.

Package version or git hash commit 04dd67da00d3e55dfb543dae098b8a14357ccb1e (HEAD -> master, origin/master, origin/HEAD)

andywolk commented 1 year ago

Are you able to fix this on your local? @MarioG-X that would speed up the process if w ecould see all issues and not just one by one

MarioG-X commented 1 year ago

The problem is I don't know C C++, etc so don't know what to needs to change, otherwise I would have done that.

andywolk commented 1 year ago
switch_core_get_rtp_port_range_end_port();

just put void inside

switch_core_get_rtp_port_range_end_port(void);
MarioG-X commented 1 year ago

That's strange, void is already inside switch_core.h:

SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_start_port(void);
/*!
 \brief Get RTP port range end value
 \param[in] void
 \param[out] RTP port range end value
*/
SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_end_port(void);
andywolk commented 1 year ago

but not in c file mentioned in the error

MarioG-X commented 1 year ago

Trying to find it:

mario@FS-Ventura-18 freeswitch % grep -r switch_core_get_rtp_port_range_end_port *
src/include/switch_core.h:SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_end_port(void);
src/switch_core.c:SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_end_port()
src/mod/languages/mod_managed/managed/swig.cs:  public static ushort switch_core_get_rtp_port_range_end_port() {
src/mod/languages/mod_managed/managed/swig.cs:    ushort ret = freeswitchPINVOKE.switch_core_get_rtp_port_range_end_port();
src/mod/languages/mod_managed/managed/swig.cs:  [global::System.Runtime.InteropServices.DllImport("mod_managed", EntryPoint="CSharp_FreeSWITCHfNative_switch_core_get_rtp_port_range_end_port___")]
src/mod/languages/mod_managed/managed/swig.cs:  public static extern ushort switch_core_get_rtp_port_range_end_port();
src/mod/languages/mod_managed/freeswitch_wrap.cxx:SWIGEXPORT unsigned short SWIGSTDCALL CSharp_FreeSWITCHfNative_switch_core_get_rtp_port_range_end_port___() {
src/mod/languages/mod_managed/freeswitch_wrap.cxx:  result = (uint16_t)switch_core_get_rtp_port_range_end_port();
andywolk commented 1 year ago

just read the error message from the first comment

src/switch_core.c:3569
MarioG-X commented 1 year ago

OK fixed it now got:

  CC       src/libfreeswitch_la-switch_core_media.lo
src/switch_core_media.c:4776:102: error: variable 'got_video_avp' set but not used [-Werror,-Wunused-but-set-variable]
        int got_crypto = 0, got_video_crypto = 0, got_audio = 0, saw_audio = 0, saw_video = 0, got_avp = 0, got_video_avp = 0, got_video_savp = 0, got_savp = 0, got_udptl = 0, got_webrtc = 0, got_text = 0, got_text_crypto = 0, got_msrp = 0;
                                                                                                            ^
src/switch_core_media.c:4776:121: error: variable 'got_video_savp' set but not used [-Werror,-Wunused-but-set-variable]
        int got_crypto = 0, got_video_crypto = 0, got_audio = 0, saw_audio = 0, saw_video = 0, got_avp = 0, got_video_avp = 0, got_video_savp = 0, got_savp = 0, got_udptl = 0, got_webrtc = 0, got_text = 0, got_text_crypto = 0, got_msrp = 0;
                                                                                                                               ^
src/switch_core_media.c:7420:34: error: variable 'vloops' set but not used [-Werror,-Wunused-but-set-variable]
        uint32_t loops = 0, xloops = 0, vloops = 0;
                                        ^
src/switch_core_media.c:14256:16: error: variable 'm_tally' set but not used [-Werror,-Wunused-but-set-variable]
        int in_m = 0, m_tally = 0, slash = 0;
                      ^
src/switch_core_media.c:14994:11: error: variable 'loops' set but not used [-Werror,-Wunused-but-set-variable]
        uint32_t loops = 0;
andywolk commented 1 year ago

it is safe to remove them

MarioG-X commented 1 year ago

OK, I did but now I got error below, do you mean remove them from all lines?

  CC       src/libfreeswitch_la-switch_core_media.lo
src/switch_core_media.c:4973:5: error: use of undeclared identifier 'got_video_savp'; did you mean 'got_video_rtcp'?
                                got_video_savp++;
                                ^~~~~~~~~~~~~~
                                got_video_rtcp
src/switch_core_media.c:4796:26: note: 'got_video_rtcp' declared here
        int got_audio_rtcp = 0, got_video_rtcp = 0;
                                ^
src/switch_core_media.c:4979:5: error: use of undeclared identifier 'got_video_avp'; did you mean 'got_video_rtcp'?
                                got_video_avp++;
                                ^~~~~~~~~~~~~
                                got_video_rtcp
src/switch_core_media.c:4796:26: note: 'got_video_rtcp' declared here
        int got_audio_rtcp = 0, got_video_rtcp = 0;
                                ^
src/switch_core_media.c:7545:3: error: use of undeclared identifier 'vloops'
                vloops++;
                ^
src/switch_core_media.c:14290:4: error: use of undeclared identifier 'm_tally'
                        m_tally++;
                        ^
src/switch_core_media.c:15005:2: error: use of undeclared identifier 'loops'
        loops++;
        ^
5 errors generated.
make[1]: *** [src/libfreeswitch_la-switch_core_media.lo] Error 1
seven1240 commented 1 year ago

yes

andywolk commented 1 year ago

just remove those undeclared

MarioG-X commented 1 year ago

Well here is evidence I don't know C, lots of errors, also, loop is used in "if, do, for" statements that I cannot remove.


 CC       src/libfreeswitch_la-switch_core_media.lo
src/switch_core_media.c:268:2: error: extra ';' inside a struct [-Werror,-Wextra-semi]
        ;
        ^
src/switch_core_media.c:7490:11: error: use of undeclared identifier 'loops'; did you mean 'xloops'?
                        if ((++loops % 100) == 0) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Waiting for video......\n");
                               ^~~~~
                               xloops
src/switch_core_media.c:7420:11: note: 'xloops' declared here
        uint32_t xloops = 0;
                 ^
src/switch_core_media.c:10910:9: error: use of undeclared identifier 'loops'
                        for (loops = 0; loops < 2; loops++) {
                             ^
src/switch_core_media.c:10910:20: error: use of undeclared identifier 'loops'
                        for (loops = 0; loops < 2; loops++) {
                                        ^
src/switch_core_media.c:10910:31: error: use of undeclared identifier 'loops'
                        for (loops = 0; loops < 2; loops++) {
                                                   ^
src/switch_core_media.c:10920:18: error: use of undeclared identifier 'loops'
                                                                                                           (loops == 0 && switch_channel_test_flag(session->channel, CF_SECURE)
                                                                                                            ^
src/switch_core_media.c:11316:9: error: use of undeclared identifier 'loops'
                                if (loops == 0 && switch_channel_test_flag(session->channel, CF_SECURE) && !switch_channel_test_flag(session->channel, CF_DTLS)) {
                                    ^
src/switch_core_media.c:10908:8: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
                        int got_vid = 0;
                            ^
src/switch_core_media.c:11490:9: error: use of undeclared identifier 'loops'
                        for (loops = 0; loops < 2; loops++) {
                             ^
src/switch_core_media.c:11490:20: error: use of undeclared identifier 'loops'
                        for (loops = 0; loops < 2; loops++) {
                                        ^
src/switch_core_media.c:11490:31: error: use of undeclared identifier 'loops'
                        for (loops = 0; loops < 2; loops++) {
                                                   ^
src/switch_core_media.c:11500:18: error: use of undeclared identifier 'loops'
                                                                                                           (loops == 0 && switch_channel_test_flag(session->channel, CF_SECURE)
                                                                                                            ^
src/switch_core_media.c:11657:9: error: use of undeclared identifier 'loops'
                                if (loops == 0 && switch_channel_test_flag(session->channel, CF_SECURE) && !switch_channel_test_flag(session->channel, CF_DTLS)) {
                                    ^
src/switch_core_media.c:15116:36: error: no member named 'ready_loops' in 'struct switch_media_handle_s'
                } else if ((*frame)->m || ++smh->ready_loops > 5) {
                                            ~~~  ^
src/switch_core_media.c:15573:11: error: use of undeclared identifier 'loops'
        plen = ((loops - 1) * 4) + 1;
                 ^
15 errors generated.
111
andywolk commented 1 year ago

it errored on vloops but you removed loops

MarioG-X commented 1 year ago

But here is line from above which shows "loops" as an error: src/switch_core_media.c:14994:11: error: variable 'loops' set but not used [-Werror,-Wunused-but-set-variable] uint32_t loops = 0;

MarioG-X commented 1 year ago

Tried to start over but here is another issue, can't remove got_video_rtcp without changing logic: if (rtcp_auto_video && !skip_video_rtcp && !got_video_rtcp && video_port) {

andywolk commented 1 year ago

just take that branch https://github.com/signalwire/freeswitch/tree/macos

MarioG-X commented 1 year ago

OK got further, next had to add void to a line in planar_functions.h in LIBYUV: ARGBBlendRow GetARGBBlend(void);

working on this on now:

  CC       src/libfreeswitch_la-switch_loadable_module.lo
src/switch_loadable_module.c:118:6: error: variable 'restarts' set but not used [-Werror,-Wunused-but-set-variable]
        int restarts;
            ^
MarioG-X commented 1 year ago

I removed the "int restarts" line but it's used in an if statement so stuck now: for (restarts = 0; status != SWITCH_STATUS_TERM && !module->shutting_down; restarts++) {

andywolk commented 1 year ago

I pushed to the branch

MarioG-X commented 1 year ago

I am not sure what to do so I will download your code from above and build now.

MarioG-X commented 1 year ago

OK got to this and will try to fix:

  CC       src/libfreeswitch_la-switch_utils.lo
src/switch_utils.c:142:6: error: variable 'x' set but not used [-Werror,-Wunused-but-set-variable]
        int x = 0;
            ^
andywolk commented 1 year ago

I've pushed

MarioG-X commented 1 year ago

Crum, when I removed the "int x = 0;" in switch_utils.c line I got this in an if statement, and "x" is used in if, for, etc, examples:

        if (*p == '\n') {
            x++;
            if (x == 2) {
src/switch_utils.c:147:3: error: use of undeclared identifier 'x'
                x++;
                ^
andywolk commented 1 year ago

just pull the branch again. I pushed a fix.

MarioG-X commented 1 year ago

Now got this, I removed the 2 lines referencing "launched" and it got to the next error below which I can't fix:

  CC       src/libfreeswitch_la-switch_event.lo
src/switch_event.c:654:6: error: variable 'launched' set but not used [-Werror,-Wunused-but-set-variable]
        int launched = 0;
            ^
  CC       src/libfreeswitch_la-switch_event.lo
src/switch_event.c:655:11: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
        uint32_t sanity = 200;
                 ^
andywolk commented 1 year ago

I have pushed an update. please pull.

MarioG-X commented 1 year ago

Now gets the errors below, I put void in for all the first errors which resolved them, but the last error "flushed" is used in if and many other statements.\:

src/switch_rtp.c:265:33: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void switch_rtp_dtls_init();
                                ^
                                 void
src/switch_rtp.c:266:36: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void switch_rtp_dtls_destroy();
                                   ^
                                    void
src/switch_rtp.c:1664:42: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static inline uint32_t calc_local_lsr_now() 
                                         ^
                                          void
src/switch_rtp.c:3497:33: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void switch_rtp_dtls_init() {
                                ^
                                 void
src/switch_rtp.c:3507:36: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void switch_rtp_dtls_destroy() {
                                   ^
                                    void
src/switch_rtp.c:5497:11: error: variable 'flushed' set but not used [-Werror,-Wunused-but-set-variable]
        uint32_t flushed = 0;
andywolk commented 1 year ago

I've pushed. Please pull.

MarioG-X commented 1 year ago

Thank you, here is the next phase: I got this error so I removed 2 l16 lines to get past it:

  CC       src/libfreeswitch_la-switch_ivr_play_say.lo
src/switch_ivr_play_say.c:1274:6: error: variable 'l16' set but not used [-Werror,-Wunused-but-set-variable]
        int l16 = 0;
            ^
src/switch_ivr_play_say.c:1337:3: error: use of undeclared identifier 'l16'
                l16++;
                ^

Then got to this and added "void" in the parens to get past it:

  CC       src/libfreeswitch_la-switch_log.lo
src/switch_log.c:249:48: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static switch_log_node_t *switch_log_node_alloc()
                                               ^
                                                void

Then go this and removed the 2 "r" lines but it looks like it could affect logic:

  CC       src/libfreeswitch_la-switch_time.lo
src/switch_time.c:1176:10: error: variable 'r' set but not used [-Werror,-Wunused-but-set-variable]
                                        int r;
                                            ^

Then got this and removed two lines using "uint64_t exp;" but again could affect logic:

  CC       src/libfreeswitch_la-switch_time.lo
src/switch_time.c:1175:15: error: unused variable 'exp' [-Werror,-Wunused-variable]
                                        uint64_t exp;
                                                 ^

Next up is speed where I added "void":

  CC       src/libfreeswitch_la-switch_speex.lo
src/switch_speex.c:473:31: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void load_configuration()
                              ^
                               void

Next is msrp where I added 7 "void"s, that fixed msrp:

  CC       src/libfreeswitch_la-switch_msrp.lo
src/switch_msrp.c:102:28: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void msrp_deinit_ssl()
                           ^
                            void
src/switch_msrp.c:115:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void msrp_init_ssl()
                         ^
                          void
src/switch_msrp.c:190:35: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static switch_status_t load_config()
                                  ^
                                   void
src/switch_msrp.c:289:51: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
SWITCH_DECLARE(const char *) switch_msrp_listen_ip()
                                                  ^
                                                   void
src/switch_msrp.c:294:49: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
SWITCH_DECLARE(switch_status_t) switch_msrp_init()
                                                ^
                                                 void
src/switch_msrp.c:349:52: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
SWITCH_DECLARE(switch_status_t) switch_msrp_destroy()
                                                   ^
                                                    void
src/switch_msrp.c:1625:59: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
SWITCH_DECLARE(switch_msrp_msg_t *) switch_msrp_msg_create()
                                                          ^
                                                           void

Next is vpx, 1 void needed:

  CC       src/libfreeswitch_la-switch_vpx.lo
src/switch_vpx.c:1856:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void load_config()
                       ^
                        void

Next miniupnpc, 2 lines using "ndev" removed:

  CC       libs/miniupnpc/libfreeswitch_la-miniupnpc.lo
libs/miniupnpc/miniupnpc.c:682:6: error: variable 'ndev' set but not used [-Werror,-Wunused-but-set-variable]
        int ndev = 0;
            ^

But then I got this one which I don't know what to do:

  CC       libs/miniupnpc/libfreeswitch_la-miniupnpc.lo
libs/miniupnpc/miniupnpc.c:683:6: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
        int state; /* state 1 : IGD connected. State 2 : IGD. State 3 : anything */
            ^
andywolk commented 1 year ago

pushed

MarioG-X commented 1 year ago

Fixed 1 line in switch.c and ok until next error below:

  CC       src/freeswitch-switch.o
src/switch.c:104:38: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static int freeswitch_kill_background()
                                     ^
                                      void

Next is fs_encode.c, 1 line fix aok:

  CC       src/fs_encode-fs_encode.o
src/fs_encode.c:49:30: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void fs_encode_cleanup()
                             ^
                              void

Next is fs_tts-fs_tts.o, 1 line fix aok:

  CC       src/fs_tts-fs_tts.o
src/fs_tts.c:49:27: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void fs_tts_cleanup()
                          ^
                           void

Next is libavmod_la-avformat.lo with multiple deprecated warnings and 1 error at end which I fixed in next post:

  CC       libavmod_la-avformat.lo
avformat.c:880:3: warning: 'av_init_packet' is deprecated [-Wdeprecated-declarations]
                av_init_packet(&pkt);
                ^
/usr/local/include/libavcodec/packet.h:487:1: note: 'av_init_packet' has been explicitly marked deprecated here
attribute_deprecated
^
/usr/local/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
#    define attribute_deprecated __attribute__((deprecated))
                                                ^
avformat.c:974:3: warning: 'av_init_packet' is deprecated [-Wdeprecated-declarations]
                av_init_packet(&pkt);
                ^
/usr/local/include/libavcodec/packet.h:487:1: note: 'av_init_packet' has been explicitly marked deprecated here
attribute_deprecated
^
/usr/local/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
#    define attribute_deprecated __attribute__((deprecated))
                                                ^
avformat.c:1430:3: warning: 'av_init_packet' is deprecated [-Wdeprecated-declarations]
                av_init_packet(&pkt);
                ^
/usr/local/include/libavcodec/packet.h:487:1: note: 'av_init_packet' has been explicitly marked deprecated here
attribute_deprecated
^
/usr/local/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
#    define attribute_deprecated __attribute__((deprecated))
                                                ^
avformat.c:1467:6: warning: 'av_init_packet' is deprecated [-Wdeprecated-declarations]
                                        av_init_packet(new_pkt);
                                        ^
/usr/local/include/libavcodec/packet.h:487:1: note: 'av_init_packet' has been explicitly marked deprecated here
attribute_deprecated
^
/usr/local/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
#    define attribute_deprecated __attribute__((deprecated))
                                                ^
avformat.c:2103:3: warning: 'av_init_packet' is deprecated [-Wdeprecated-declarations]
                av_init_packet(&pkt[0]);
                ^
/usr/local/include/libavcodec/packet.h:487:1: note: 'av_init_packet' has been explicitly marked deprecated here
attribute_deprecated
^
/usr/local/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
#    define attribute_deprecated __attribute__((deprecated))
                                                ^
avformat.c:2104:3: warning: 'av_init_packet' is deprecated [-Wdeprecated-declarations]
                av_init_packet(&pkt[1]);
                ^
/usr/local/include/libavcodec/packet.h:487:1: note: 'av_init_packet' has been explicitly marked deprecated here
attribute_deprecated
^
/usr/local/include/libavutil/attributes.h:100:49: note: expanded from macro 'attribute_deprecated'
#    define attribute_deprecated __attribute__((deprecated))
                                                ^
avformat.c:2862:35: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static switch_status_t load_config()
                                  ^
                                   void
6 warnings and 1 error generated.

See next post for fix to last item:

MarioG-X commented 1 year ago

Fixed avformat.c added void fixed last issue above.

Next is avcodec.c, fixed 1 line aok:

avcodec.c:2211:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void load_config()
                       ^
                        void

Next is mod_cdr_csv.c, added void to 2 lines aok:

  CC       mod_cdr_csv_la-mod_cdr_csv.lo
mod_cdr_csv.c:275:26: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void do_rotate_all()
                         ^
                          void
mod_cdr_csv.c:297:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void do_teardown()
                       ^
                        void

Next is mod_conference.h, 1 line add void aok:

In file included from mod_conference.c:42:
./mod_conference.h:1126:32: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
int conference_loop_mapping_len();
                               ^
                                void

Next is conference_api.c, removed count from 3-4 lines aok:

  CC       libmodconference_la-conference_api.lo
conference_api.c:4090:6: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
        int count = 0;
            ^

Next is conference_api.c, stuck on this one so stopped for now:

conference_api.c:4091:23: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
        switch_hash_index_t *hi;
                             ^
andywolk commented 1 year ago

pushed

MarioG-X commented 1 year ago

The first one from the last post is still there:

Next is avcodec.c, fixed 1 line aok:

avcodec.c:2211:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static void load_config()
                       ^
                        void

Next is conference_cdr.c, removed 3 lines using "wrote", aok:

   CC       libmodconference_la-conference_cdr.lo
conference_cdr.c:738:9: error: variable 'wrote' set but not used [-Werror,-Wunused-but-set-variable]
                                int wrote;
                                    ^
conference_cdr.c:738:5: error: use of undeclared identifier 'wrote'
                                wrote = write(fd, xml_text, (unsigned) strlen(xml_text));
                                ^

Next is mod_db.c, added void to 1 line aok:

  CC       mod_db_la-mod_db.lo
mod_db.c:283:33: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static switch_status_t do_config()
                                ^
                                 void

Now stuck at mod_dptools.c, removing x caused many other errors, I tried deleting 1 line at a time, no luck:

  CC       mod_dptools_la-mod_dptools.lo
mod_dptools.c:164:6: error: variable 'x' set but not used [-Werror,-Wunused-but-set-variable]
        int x = 0;
            ^
andywolk commented 1 year ago

pushed

MarioG-X commented 1 year ago

mod_event_socket.c errors are messy, Removed many "count" lines but then key_count had errors (below):

  CC       mod_event_socket_la-mod_event_socket.lo
mod_event_socket.c:869:12: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
                uint32_t count = 0, key_count = 0;
                         ^
mod_event_socket.c:1849:10: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
                                        int count = 0, custom = 0, key_count = 0;
                                            ^
mod_event_socket.c:1849:33: error: variable 'key_count' set but not used [-Werror,-Wunused-but-set-variable]
                                        int count = 0, custom = 0, key_count = 0;
                                                                   ^
mod_event_socket.c:1907:10: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
                                        int count = 0;
                                            ^
mod_event_socket.c:2543:12: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
                uint32_t count = 0, key_count = 0;
                         ^
5 errors generated.

After removing count in more places I got to this point:

  CC       mod_event_socket_la-mod_event_socket.lo
mod_event_socket.c:928:26: error: use of undeclared identifier 'count'
                        for (cur = edup; cur; count++) {
                                              ^
mod_event_socket.c:1296:6: error: use of undeclared identifier 'count'
                                        count++;
                                        ^
mod_event_socket.c:1297:10: error: use of undeclared identifier 'count'; did you mean 'round'?
                                        if (count == 1) {
                                            ^~~~~
                                            round
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:476:15: note: 'round' declared here
extern double round(double);
              ^
mod_event_socket.c:1864:28: error: use of undeclared identifier 'count'
                                        for (cur = edup; cur; count++) {
                                                              ^
mod_event_socket.c:1917:28: error: use of undeclared identifier 'count'
                                        for (cur = edup; cur; count++) {
                                                              ^

Then removed count++ from several lines, but that looked like logic would change on some lines. But it got me to:

  CC       mod_event_socket_la-mod_event_socket.lo
mod_event_socket.c:1296:10: error: use of undeclared identifier 'count'; did you mean 'round'?
                                        if (count == 1) {
                                            ^~~~~
                                            round
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:476:15: note: 'round' declared here
extern double round(double);
              ^
mod_event_socket.c:1847:22: error: variable 'key_count' set but not used [-Werror,-Wunused-but-set-variable]
                                        int custom = 0, key_count = 0;
                                                        ^

I changed count in the "if" above to crcount, I know it's wrong but I wanted to get past error to find more.

I removed "key_count" in different places finally got it to make by removing key_count in two places one being:

                            switch_core_hash_insert(listener->allowed_event_hash, cur, MARKER);
                        } else if (switch_name_event(cur, &type) == SWITCH_STATUS_SUCCESS) {
                            key_count++;
                            if (type == SWITCH_EVENT_ALL) {

After all that event_socket completed make. The changes are not right but allowed to find next problem.

MarioG-X commented 1 year ago

Now that event_socket built, next is signalwire-client-c, first run before my changes gets this (see next post for second attempt):

  CC       mod_signalwire_la-mod_signalwire.lo
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:25:
In file included from /usr/local/include/libks/ks.h:58:
/usr/local/include/libks/ks_log.h:47:42: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
KS_DECLARE(void) ks_global_close_file_log();
                                         ^
                                          void
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:25:
In file included from /usr/local/include/libks/ks.h:60:
/usr/local/include/libks/ks_handle.h:163:39: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
KS_DECLARE(ks_status_t) ks_handle_init();
                                      ^
                                       void
/usr/local/include/libks/ks_handle.h:164:36: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
KS_DECLARE(void) ks_handle_shutdown();
                                   ^
                                    void
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:25:
In file included from /usr/local/include/libks/ks.h:63:
/usr/local/include/libks/ks_json.h:41:32: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
KS_DECLARE(void) ks_json_deinit();
                               ^
                                void
/usr/local/include/libks/ks_json.h:42:30: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
KS_DECLARE(void) ks_json_init();
                             ^
                              void
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:25:
In file included from /usr/local/include/libks/ks.h:67:
/usr/local/include/libks/ks_debug.h:61:41: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
KS_DECLARE(void) ks_debug_dump_backtrace();
                                        ^
                                         void
/usr/local/include/libks/ks_debug.h:63:32: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
KS_DECLARE(void) ks_debug_break();
                               ^
                                void
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:25:
In file included from /usr/local/include/libks/ks.h:76:
/usr/local/include/libks/ks_dso.h:63:33: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
KS_DECLARE(void) ks_dso_shutdown();
                                ^
                                 void
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:25:
In file included from /usr/local/include/libks/ks.h:81:
/usr/local/include/libks/ks_uuid.h:37:46: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
KS_DECLARE(const char *) ks_uuid_null_thr_str();
                                             ^
                                              void
/usr/local/include/libks/ks_uuid.h:38:35: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
KS_DECLARE(ks_uuid_t) ks_uuid_null();
                                  ^
                                   void
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:29:
/usr/local/include/signalwire-client-c/init.h:28:42: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
SWCLT_DECLARE(ks_status_t) swclt_shutdown();
                                         ^
                                          void
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:40:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_CHANNEL, blade_channel_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:65:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_VERSION, blade_version_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:94:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_NODE, blade_node_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:116:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_PROVIDER, blade_provider_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:143:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_SUBSCRIPTION, blade_subscription_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:170:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_PROTOCOL, blade_protocol_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:32:
/usr/local/include/signalwire-client-c/blade/connect.h:46:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_CONNECT_RQU, blade_connect_rqu_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:32:
/usr/local/include/signalwire-client-c/blade/connect.h:81:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_CONNECT_RPL, blade_connect_rpl_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
MarioG-X commented 1 year ago

I added void to all of the applicable messages above, and got to this point which unfortunately don't; know how to get further:

  CC       mod_signalwire_la-mod_signalwire.lo
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:40:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_CHANNEL, blade_channel_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:65:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_VERSION, blade_version_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:94:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_NODE, blade_node_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:116:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_PROVIDER, blade_provider_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:143:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_SUBSCRIPTION, blade_subscription_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:31:
/usr/local/include/signalwire-client-c/blade/type.h:170:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_PROTOCOL, blade_protocol_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:32:
/usr/local/include/signalwire-client-c/blade/connect.h:46:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_CONNECT_RQU, blade_connect_rqu_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:32:
/usr/local/include/signalwire-client-c/blade/connect.h:81:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_CONNECT_RPL, blade_connect_rpl_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:33:
/usr/local/include/signalwire-client-c/blade/disconnect.h:38:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_DISCONNECT_RQU, blade_disconnect_rqu_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:33:
/usr/local/include/signalwire-client-c/blade/disconnect.h:93:54: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static inline swclt_cmd_t CREATE_BLADE_DISCONNECT_CMD()
                                                     ^
                                                      void
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:36:
/usr/local/include/signalwire-client-c/blade/broadcast.h:42:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_BROADCAST_RQU, blade_broadcast_rqu_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:37:
/usr/local/include/signalwire-client-c/blade/execute.h:72:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_EXECUTE_RPL, blade_execute_rpl_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:37:
/usr/local/include/signalwire-client-c/blade/execute.h:97:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_EXECUTE_ERR, blade_execute_err_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:38:
/usr/local/include/signalwire-client-c/blade/identity.h:42:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_IDENTITY_RQU, blade_identity_rqu_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:39:
/usr/local/include/signalwire-client-c/blade/protocol.h:46:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_PROTOCOL_RQU, blade_protocol_rqu_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:39:
/usr/local/include/signalwire-client-c/blade/protocol.h:76:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_PROTOCOL_PROVIDER_ADD_PARAM, blade_protocol_provider_add_param_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:39:
/usr/local/include/signalwire-client-c/blade/protocol.h:112:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_PROTOCOL_PROVIDER_RANK_UPDATE_PARAM, blade_protocol_provider_rank_update_param_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:41:
/usr/local/include/signalwire-client-c/blade/subscription.h:66:1: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
SWCLT_JSON_MARSHAL_BEG(BLADE_SUBSCRIPTION_RQU, blade_subscription_rqu_t)
^
/usr/local/include/signalwire-client-c/JSON/macros.h:297:14: note: expanded from macro 'SWCLT_JSON_MARSHAL_BEG'
                ks_json_t *target = ks_json_pcreate_object(pool);                                                                                       \
                           ^
In file included from mod_signalwire.c:28:
In file included from /usr/local/include/signalwire-client-c/client.h:38:
In file included from /usr/local/include/signalwire-client-c/blade/blade.h:41:
/usr/local/include/signalwire-client-c/blade/subscription.h:104:27: error: mixing declarations and code is incompatible with standards before C99 [-Werror,-Wdeclaration-after-statement]
        blade_subscription_rqu_t request = {
                                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
MarioG-X commented 1 year ago

Andywolk, any movement on this? Is it more complicated than originally thought? With your changes I did get all the way to signalwire module. Seems you got close. Just checking.

MarioG-X commented 1 year ago

I found https://github.com/Homebrew/homebrew-core/commit/bac10a5c3d7e0a770372a0e3e9c13b556b8f98d5 which contains CFLAGS "-Wno-implicit-function-declaration". So I tried: ./configure CFLAGS="-Wno-implicit-function-declaration" CXXFLAGS="-Wno-implicit-function-declaration" CPPFLAGS="-Wno-implicit-function-declaration"

But it failed the same way: CC src/libfreeswitch_la-switch_core.lo src/switch_core.c:3569:67: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] SWITCH_DECLARE(uint16_t) switch_core_get_rtp_port_range_start_port()

Also tried this and same results: ./configure CFLAGS="-Wno-error=implicit-function-declaration" CXXFLAGS="-Wno-error=implicit-function-declaration" CPPFLAGS="-Wno-error=implicit-function-declaration"

Also tried this and same results: ./configure CFLAGS="-Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=strict-prototypes"

There a lot of information about clang changes causing this going back to 2020: Here are two long explanations, there are a lot more web activity about this:

https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213

MarioG-X commented 1 year ago

This is on an Intel Mac so it is not related to Apple Silicon.

MarioG-X commented 1 year ago

Notification of a future issue that may be prevented: I built on Sonoma using the newer Command Line Tools 15 Beta (newer clang) and received this error before the ones documented in this issue:

src/switch_core_sqldb.c:705:13: error: implicit conversion from enumeration type 'switch_odbc_status_t' to different enumeration type 'switch_status_t' [-Werror,-Wenum-conversion]
                        status = switch_odbc_handle_exec(dbh->native_handle.odbc_dbh, sql, NULL, &errmsg);
                               ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In the previous clang 14, there was no warning for switch-core_db. So this is a new clang test, or FS changed since (unlikely).

jakubkarolczyk commented 1 year ago

please update sofia-sip, libks, signalwire-c to the latest master. Best to make a fresh clone of FS and build macos branch. Do not add any flags when running configure

MarioG-X commented 1 year ago

I always update everything before building. Also, I always create and download new FS. I created and maintained the macOS FreeSwitch Wiki since 2010 so had to do it always clean, sometimes even removing all of /local. If you're not experience this issue, you're probably not on the latest Command Line Tools from Apple. This is also noted on the Homebrew issues for FreeSwitch. It started with the latest Apple CLT.

jakubkarolczyk commented 1 year ago

Sorry for being not too much specific in my last comment. For past days, I did a job to fix MacOS build related issues in libs I mentioned and FS, so now it builds successfully on our mac dev box. However, libs are not updated in homebrew yet, we'll let you know when they will be.

MarioG-X commented 1 year ago

Looking forward to it! Thank you! If you let me now via this issue I will run tests.

MarioG-X commented 1 year ago

Tried Master today since I saw some updates. Got far except failed many places in flite, when I removed flite make failed in opus:

 making all mod_flite
 CC       mod_flite_la-mod_flite.lo
In file included from mod_flite.c:34:
In file included from /usr/local/include/flite/flite.h:48:
/usr/local/Cellar/flite/2.0.0/include/flite/cst_regex.h:140:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void cst_regex_init();
                   ^
                    void
making all mod_opus
  CC       mod_opus_la-mod_opus.lo
mod_opus.c:1177:78: error: implicit conversion from enumeration type 'switch_bool_t' to different enumeration type 'bool_t' [-Werror,-Wenum-conversion]
        if (!switch_opus_packet_parse(payload, encoded_data_len, &opus_packet_info, debug)) {
             ~~~~~~~~~~~~~~~~~~~~~~~~                                               ^~~~~
jakubkarolczyk commented 1 year ago

Opus is sorted out. mod_flite - the issue is in external library, nothing to do in FS https://github.com/festvox/flite/blob/6c9f20dc915b17f5619340069889db0aa007fcdc/include/cst_regex.h#L140C23-L140C23

MarioG-X commented 1 year ago

Thanks, it got further but failed same way in Sofia:

making all mod_sofia
  CC       test/test_sofia_funcs-test_sofia_funcs.o
  CC       libsofiamod_la-mod_sofia.lo
In file included from mod_sofia.c:41:
In file included from ./mod_sofia.h:139:
In file included from /usr/local/Cellar/sofia-sip/1.13.15_1/include/sofia-sip-1.13/sofia-sip/sip_protos.h:43:
/usr/local/Cellar/sofia-sip/1.13.15_1/include/sofia-sip-1.13/sofia-sip/sip_header.h:70:44: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
SOFIAPUBFUN void sip_default_mclass_restore();
                                           ^
                                            void