mirror of
https://git.freebsd.org/ports.git
synced 2025-07-17 17:29:23 -04:00
emulators/rtc: Unbreak build with llvm13
rtc.c:112:6: error: variable 'unit' set but not used [-Werror,-Wunused-but-set-variable] int unit; ^ PR: 263616
This commit is contained in:
parent
71c2509817
commit
e2c8ca5df4
1 changed files with 6 additions and 0 deletions
|
@ -109,10 +109,16 @@ static struct rtc_softc *
|
||||||
rtc_attach(struct cdev *dev)
|
rtc_attach(struct cdev *dev)
|
||||||
{
|
{
|
||||||
struct rtc_softc *sc;
|
struct rtc_softc *sc;
|
||||||
|
/* Clang 13+ realises that "unit" below isn't actually used if we */
|
||||||
|
/* aren't running with DEBUG set. The warning is treated as a */
|
||||||
|
/* fatal error by FreeBSD's kmod build system, so wrap its usage */
|
||||||
|
/* within DEBUG pre-processor conditionals. - Jamie Landeg-Jones */
|
||||||
|
#if DEBUG
|
||||||
int unit;
|
int unit;
|
||||||
|
|
||||||
unit = dev2unit(dev);
|
unit = dev2unit(dev);
|
||||||
DLog(Lenter, "%d %p", unit, dev);
|
DLog(Lenter, "%d %p", unit, dev);
|
||||||
|
#endif /* DEBUG */
|
||||||
if (dev->si_drv1) {
|
if (dev->si_drv1) {
|
||||||
DLog(Lexit, "old %p, %p", dev, dev->si_drv1);
|
DLog(Lexit, "old %p, %p", dev, dev->si_drv1);
|
||||||
return dev->si_drv1;
|
return dev->si_drv1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue