-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
drivers/snmp-ups.c: usmAESPrivProtocol is not an array to properly use a sizeof() #850
drivers/snmp-ups.c: usmAESPrivProtocol is not an array to properly use a sizeof() #850
Conversation
snmp-ups.c: In function 'nut_snmp_init': snmp-ups.c:599:66: error: division 'sizeof (oid * {aka long unsigned int *}) / sizeof (oid {aka long unsigned int})' does not compute the number of array elements [-Werror=sizeof-pointer-div] 599 | g_snmp_sess.securityPrivProtoLen = sizeof(usmAESPrivProtocol)/sizeof(oid); | ^ In file included from /usr/include/net-snmp/snmpv3_api.h:27, from /usr/include/net-snmp/net-snmp-includes.h:78, from snmp-ups.h:79, from snmp-ups.c:39: /usr/include/net-snmp/library/transform_oids.h:50:26: note: first 'sizeof' operand was declared here 50 | NETSNMP_IMPORT oid *usmAES128PrivProtocol; /* backwards compat */ | ^~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:1953: snmp_ups-snmp-ups.o] Error 1
This pull request introduces 1 alert when merging 7bcaa25 into 8c1ad08 - view on LGTM.com new alerts:
|
…ES128PrivProtocol
This pull request introduces 1 alert when merging c7cf507 into 3f9225d - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging f8667a4 into e65acaa - view on LGTM.com new alerts:
|
Some investigation showed that the token we use is defined in current net-snmp headers as a legacy pointer type, |
It is more than a warning. Because incorrect length of See #734 (comment) |
Hell @Bi11 and sorry for the delay. I've read through this and linked comments, and my understanding is that with the current state of the master branch (or at least with these fixes applied to your build) AES works for you, while in the (aged) 2.7.4 release it did not? Can you clarify please if there remains something to fix in |
I've just tried the master branch, the "sizeof" issue in 2.7.4 has been fixed with your commits, both in However, |
Thank you very much for confirmations! I know about 1200 warnings remain
per clang-9, though most are relatively trivial double-vs-float and
int-unsigned-size_t which should not be fatal.
A few left me scratching my head, as attempts to quickly fix grew into a
big can of worms to pull. So I wanted to fix others first and then better
see impact of remaining efforts, like when warnings appear in previously
green code :)
If you want to join this crusade, note the "fightwarn" branch often
contains a few fixes ahead of those committed to master.
…On Sat, Dec 12, 2020, 17:21 Bi11 ***@***.***> wrote:
I've just tried the master branch, the "sizeof" issue in 2.7.4 has been
fixed with your commits, both in drivers/snmp-ups and nut-scanner. I'm
really appreciated for your improvements made to this project, @jimklimov
<https://github.com/jimklimov>.
However, nut-scanner is still not working with my UPS, and there are some
other trivial issues. I'll create a new Issue or PR once I make it work
with my UPS.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#850 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMPTFCUZ5IOWEXTXCFTABDSUOJ75ANCNFSM4TOEKDQA>
.
|
In my recent fight against warnings in NUT codebase, augmented by #844 and following from #823, this issue remains the only one I don't have an idea about solving. Help would be very much welcome to make a lot of additional Travis CI test-cases green.