Page MenuHomeFreeBSD

libthr: fix warnings from GCC when WARNS=6
ClosedPublic

Authored by vangyzen on May 23 2017, 1:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 31, 7:26 AM
Unknown Object (File)
Oct 2 2024, 10:10 PM
Unknown Object (File)
Sep 27 2024, 6:17 PM
Unknown Object (File)
Sep 24 2024, 3:21 PM
Unknown Object (File)
Sep 16 2024, 11:27 AM
Unknown Object (File)
Sep 16 2024, 9:06 AM
Unknown Object (File)
Sep 8 2024, 7:10 PM
Unknown Object (File)
Sep 7 2024, 3:09 PM
Subscribers

Details

Summary

Fix warnings about redundant declarations, a local variable shadowing
a global function (dlinfo), and an old-style function definition
(with an empty parameter list).

Test Plan

make tinderbox passes (except for a few unrelated kernel failures)

Diff Detail

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

Event Timeline

I added _.riscv.* to the svn:ignore property. I'll commit that separately.

kib added inline comments.
lib/libthr/thread/thr_private.h
873 ↗(On Diff #28709)

Since the #if's become nested, I would consider adding comments to #endif lines.

This revision is now accepted and ready to land.May 23 2017, 1:40 PM
include/stdio.h
467 ↗(On Diff #28709)

I don't particularly like this, but it follows precedent.

An alternative would move the declaration into a common header file, but I couldn't identify a good candidate, and I didn't think creating one was worth the effort.

I'm open to suggestion, of course.

lib/libthr/thread/thr_private.h
841 ↗(On Diff #28709)

I don't particularly like this. It requires consumers to include libc_private.h before thr_private.h. It also adds maintenance, because additions to libc_private.h might require adjustments here. However, given the limited usage of these files, both of these requirements seem fairly reasonable.

An alternative would create a new, common header file, such as libc_thr_private.h, included by libc_private.h and thr_private.h.

I'm open to suggestion, of course.

This revision was automatically updated to reflect the committed changes.