Page MenuHomeFreeBSD

Clean up compiler warnings in sysctl(8)
AbandonedPublic

Authored by trasz on Mar 24 2020, 12:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 30, 9:49 PM
Unknown Object (File)
Jan 3 2026, 2:34 PM
Unknown Object (File)
Dec 19 2025, 9:21 PM
Unknown Object (File)
Dec 17 2025, 7:31 PM
Unknown Object (File)
Dec 14 2025, 8:58 PM
Unknown Object (File)
Dec 11 2025, 7:04 AM
Unknown Object (File)
Dec 8 2025, 12:29 PM
Unknown Object (File)
Dec 2 2025, 7:14 AM
Subscribers

Details

Reviewers
cem
Summary

Clean up compiler warnings in sysctl(8).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30724
Build 28452: arc lint + arc unit

Event Timeline

Pacify gcc, just in case.

Mostly LGTM, thanks.

sbin/sysctl/sysctl.c
738

The second (struct efi_md *) cast can be dropped. It is redundant.

907

Alternatively, just memcpy(kind, buf, sizeof(*kind)); here and drop the other changes to this function.

sys/sys/efi.h
96

The second struct efi_md * cast is redundant here as well, unless something is directly acting on this macro like: efi_next_descriptor(...)->md_phys. Which, I hope not.

sbin/sysctl/sysctl.c
940โ€“941

Is this still needed?

Fix issues pointed out by cem@.

trasz added inline comments.
sbin/sysctl/sysctl.c
940โ€“941

Unfortunately yes, even with new GCC.

sys/sys/efi.h
96

I think I'd rather leave it for now, quick grep shows nobody uses it like that, but it is a valid way to call it.