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

overflow in conversion from ‘size_t’ {aka ‘long unsigned int’} to ‘int’ changes value from ‘18446744073709551608’ to ‘-8’ [-Woverflow] #9

Open
asarubbo opened this issue Oct 18, 2022 · 0 comments

Comments

@asarubbo
Copy link

Hello Dave,

during the compilation of drachtio-server I noticed:

In file included from ../deps/sofia-sip/libsofia-sip-ua/sip/sofia-sip/sip_parser.h:52,
                 from ../src/test_parser.cpp:11:
../deps/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_parser.h: In function ‘isize_t msg_params_dup_xtra(const char* const*, isize_t)’:
../deps/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_parser.h:272:55: warning: overflow in conversion from ‘size_t’ {aka ‘long unsigned int’} to ‘int’ changes value from ‘18446744073709551608’ to ‘-8’ [-Woverflow]
 #define MSG_PARAMS_NUM(n) (((n) + MSG_N_PARAMS - 1) & (size_t)(0 - MSG_N_PARAMS))
                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_parser.h:323:15: note: in expansion of macro ‘MSG_PARAMS_NUM’
     offset += MSG_PARAMS_NUM(n + 1) * sizeof(msg_param_t);
               ^~~~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant