-
Notifications
You must be signed in to change notification settings - Fork 553
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
[orchagent] Arm 32-bit arch compilation warning Fixes #1488
Conversation
Signed-off-by: Sabareesh Kumar Anandan <[email protected]>
orchagent/mirrororch.cpp
Outdated
@@ -748,7 +748,7 @@ bool MirrorOrch::setUnsetPortMirror(Port port, | |||
if (set) | |||
{ | |||
port_attr.value.objlist.count = 1; | |||
port_attr.value.objlist.list = (long unsigned int *)calloc(port_attr.value.objlist.count, sizeof(sai_object_id_t)); | |||
port_attr.value.objlist.list = reinterpret_cast<sai_object_id_t *>((void *)calloc(port_attr.value.objlist.count, sizeof(sai_object_id_t))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calloc [](start = 83, length = 6)
calloc
already returns a void *
. Why you need to convert explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reinterpret cast reports error if we don't explicitly type cast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean why convert calloc
to void *
. It is already void *
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed explicit cast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comment
Signed-off-by: Sabareesh Kumar Anandan <[email protected]>
**What I did** Replaced %l variants with PRI format specifier to fix compilation warnings for arm 32-bit arch **How I verified it** Compiled and verified for arm 32-bit arch (marvell-armhf) * [orchagent] Arm 32-bit arch compilation warning Fixes * [orchagent] removed explicit type cast
Signed-off-by: Sabareesh Kumar Anandan [email protected]
What I did
Replaced %l variants with PRI format specifier to fix compilation warnings for arm 32-bit arch
Why I did it
How I verified it
Compiled and verified for arm 32-bit arch (marvell-armhf)
Details if related