Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings related to mismatch of function parameters #471

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

miconda
Copy link
Contributor

@miconda miconda commented Dec 12, 2023

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.

- even not used, one is given when function is executed
- fix for warning: passing arguments to 'msg_create' without a prototype
is deprecated in all versions of C and is not supported in C2x
- NULL is given as parameter on function execution
- it is defined with parameter capture_info_t *capinfo
- fix for 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
@Kaian
Copy link
Member

Kaian commented Dec 20, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants