irontec / sngrep

Ncurses SIP Messages flow viewer
GNU General Public License v3.0
1.02k stars 187 forks source link

Fix warnings related to mismatch of function parameters #471

Closed miconda closed 1 month ago

miconda commented 11 months ago

Compiling latest devel version on MacOS 14.1 resulted in warnings:

In file included from capture.c:39:
./capture.h:316:1: warning: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition [-Wdeprecated-non-prototype]
capture_launch_thread();
^
capture.c:1042:1: note: conflicting prototype is here
capture_launch_thread(capture_info_t *capinfo)
^
1 warning generated.
  CC       sngrep-address.o
  CC       sngrep-packet.o
  CC       sngrep-sip.o
sip.c:352:27: warning: passing arguments to 'msg_create' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
    if (!(msg = msg_create((const char*) payload)))
                          ^
1 warning generated.

This PR makes an attempt to fix them, not sure if it is the best way or other values/usage for parameters should be expected.

Kaian commented 11 months ago

Hi @miconda !!

I think those functions shouldn't have parameters, so I will change the usage rather than the declaration.

Thanks a lot for raising these warnings!

Best regards

linuxmaniac commented 1 month ago

I think this one should be closed, no?

Kaian commented 1 month ago

Sorry, I totally forgot about this.

This could be merged long time ago.

Thanks both for the PR and reminder!

miconda commented 1 month ago

@Kaian: I thought you did a different commit to fix the warnings (referenced also above, id: a645254). So I guess this should have just been closed, not merged ...

Kaian commented 1 month ago

Oh! My bad!

I have been on holidays for a whole month and looks like I forgot to read. I've removed the commits from master.

Thanks again!!