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

A few trivial fixes to build warnings on 64bit targets #62

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

Conversation

aescolar
Copy link
Member

@aescolar aescolar commented Oct 25, 2024

I have no clue how you guys are handling this fork, if you want me to add some tag to the commit titles or so just tell.
You are also welcome to modify the commits or do anything with them as you please.

Fix multiple size_t print format specifiers

The format specifier for size_t is zu.
Using d only works when int and size_t are the same
underlying type which is not the case for 64bit systems,
which leads to a build warning in this case.

In 2 places, instead of changing the printf specifier
the type of the variable was changed to int, as that
was what the code really exepected.
And while at it, two internal function have been made static.

Fix overflow warning for 64bit builds

Fix the following build warning:

ap_drv_ops.c:272:41: warning: overflow in conversion from
‘long unsigned int’ to ‘int’ changes value from ‘18446744073709551614’
to ‘-2’ [-Woverflow]
  272 |                                      0, ~WPA_STA_AUTHORIZED);

Partial fix for
zephyrproject-rtos/zephyr#80437

Fix the following build warning:

ap_drv_ops.c:272:41: warning: overflow in conversion from
‘long unsigned int’ to ‘int’ changes value from ‘18446744073709551614’
to ‘-2’ [-Woverflow]
  272 |                                      0, ~WPA_STA_AUTHORIZED);

Signed-off-by: Alberto Escolar Piedras <[email protected]>
The format specifier for size_t is zu.
Using d only works when int and size_t are the same
underlying type which is not the case for 64bit systems,
which leads to a build warning in this case.

In 2 places, instead of changing the printf specifier
the type of the variable was changed to int, as that
was what the code really exepected.
And while at it, two internal function have been made static.

Signed-off-by: Alberto Escolar Piedras <[email protected]>
@aescolar aescolar changed the title A few trivial fixes that cause build warnings on 64bit targets A few trivial fixes to build warnings on 64bit targets Oct 25, 2024
@jukkar
Copy link
Member

jukkar commented Oct 25, 2024

Hmm, I think at this point we could avoid compiling with native_sim64. We do not want to deviate too much from upstream with this kind of changes.

@aescolar
Copy link
Member Author

Hmm, I think at this point we could avoid compiling with native_sim64. We do not want to deviate too much from upstream with this kind of changes.

It's fine if you want to handle it that way. The issues, even if trivial, are valid though, so I guess we can also queue it to the upstream.

@jukkar
Copy link
Member

jukkar commented Oct 25, 2024

The issues, even if trivial, are valid though, so I guess we can also queue it to the upstream.

Yes that is true. We have a plan to merge upstream changes after 4.0 so this might be fixed already.

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

Successfully merging this pull request may close these issues.

2 participants