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

OCS_off_t should be a signed type #593

Closed
jphickey opened this issue Sep 5, 2020 · 0 comments · Fixed by #594 or #596
Closed

OCS_off_t should be a signed type #593

jphickey opened this issue Sep 5, 2020 · 0 comments · Fixed by #594 or #596
Labels
Milestone

Comments

@jphickey
Copy link
Contributor

jphickey commented Sep 5, 2020

Describe the bug
OCS_off_t is used for OSAL coverage testing to replace the C library off_t type as used in e.g. lseek()
This is being substituted with an unsigned type, but really should be a signed type.

To Reproduce
Suggested change in PR #592 exposes the mismatch:

https://github.com/klystron78/osal/blob/862f1322da247b1ae8a93a9e25e3f76bb5fa8d8e/src/os/portable/os-impl-posix-io.c#L106

Coverage test fails due to later comparison for (result < 0) which is impossible with unsigned type.

System observed on:
Ubuntu 20.04

Additional context
Using long instead fixes it.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

jphickey added a commit to jphickey/osal that referenced this issue Sep 5, 2020
The C library type is signed, and this makes the
result check work as intended.
yammajamma added a commit that referenced this issue Sep 10, 2020
Fix #593, change OCS_off_t to a signed type
@astrogeco astrogeco added this to the 6.0.0 milestone Sep 22, 2020
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants