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)
Mar 11 2024, 7:50 AM
Unknown Object (File)
Mar 11 2024, 7:50 AM
Unknown Object (File)
Mar 11 2024, 7:50 AM
Unknown Object (File)
Mar 7 2024, 10:37 PM
Unknown Object (File)
Jan 5 2024, 11:30 PM
Unknown Object (File)
Jan 5 2024, 11:26 PM
Unknown Object (File)
Jan 5 2024, 11:26 PM
Unknown Object (File)
Jan 3 2024, 6:18 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.