Page MenuHomeFreeBSD

Misc compiler warning fixes in lib/libc
ClosedPublic

Authored by asomers on Sep 23 2020, 6:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 28, 1:09 PM
Unknown Object (File)
Fri, Jul 18, 3:03 AM
Unknown Object (File)
Sun, Jul 6, 12:44 PM
Unknown Object (File)
Jun 23 2025, 12:43 AM
Unknown Object (File)
Jun 13 2025, 12:59 AM
Unknown Object (File)
Jun 11 2025, 7:57 PM
Unknown Object (File)
Jun 3 2025, 8:28 PM
Unknown Object (File)
Jun 1 2025, 6:47 AM
Subscribers

Details

Summary

Misc compiler warning fixes in lib/libc

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/libc/gen/auxv.c
270 ↗(On Diff #77447)

Shouldn't we declare buflen to be a size_t instead?

lib/libc/gen/auxv.c
270 ↗(On Diff #77447)

Can't, because _elf_aux_info must have the same signature as elf_aux_info

lib/libc/gen/auxv.c
270 ↗(On Diff #77447)

Then maybe we should widen buflen to size_t instead of narrowing the return value of strlcpy.

btw, the rest of the changes look totally fine. Sorry to be so nitpicky over this one...

lib/libc/gen/auxv.c
270 ↗(On Diff #77447)

and do we need to make sure buflen isn't less than zero?

asomers marked 3 inline comments as done.

Handle buflen more carefully in _elf_aux_info

kevans added inline comments.
lib/libc/gen/auxv.c
270 ↗(On Diff #77447)

I would've perhaps opted to just widen it for this one comparison after checking that it's not negative above, but I think it's fine either way.

This revision is now accepted and ready to land.Sep 25 2020, 7:11 PM
This revision was automatically updated to reflect the committed changes.