Opened 5 weeks ago

Closed 4 weeks ago

#31673 closed defect (fixed)

Deprecated use of <sys/sysctl.h>

Reported by: dgoulet Owned by:
Priority: Medium Milestone: Tor: 0.4.1.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 029-backport, 035-backport 040-backport 041-backport 042-must
Cc: Actual Points:
Parent ID: Points: 0.1
Reviewer: nickm Sponsor:

Description

I've been getting warnings since couple days ago:

/usr/include/x86_64-linux-gnu/sys/sysctl.h:21:2: warning: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Wcpp]
   21 | #warning "The <sys/sysctl.h> header is deprecated and will be removed."

It is annoying with enable-gcc-warnings since it errors.

I've removed that include and tor builds fine so, as nickm suggested on IRC, right solution here is to not include on Linux/Win32 instead of #ifdef HAVE_SYS_SYSCTL_H.

I would recommend a backport since if this becomes a problem to build tor in the future.

Child Tickets

Change History (12)

comment:1 Changed 5 weeks ago by nickm

Keywords: 042-should easy added

comment:2 Changed 5 weeks ago by dgoulet

Keywords: 042-should easy removed
Reviewer: nickm
Status: newneeds_review

There are two approaches to this I believe. Either we keep HAVE_SYS_SYSCTL_H but add !defined(__GLIBC__) or we just remove this entirely and only include it _not_ for LInux/Win32 since most BSD flavors still uses it afaict.

I went with the latter.

029: https://github.com/torproject/tor/pull/1305
035: https://github.com/torproject/tor/pull/1307

035 PR merges forward successfully.

Last edited 5 weeks ago by dgoulet (previous) (diff)

comment:3 Changed 5 weeks ago by nickm

I'm not sure whether removing the HAVE_SYS_SYSCTL_H is correct for all the other places we build (ios, etc).

comment:4 Changed 5 weeks ago by dgoulet

Fixed!

comment:5 Changed 5 weeks ago by nickm

Status: needs_reviewneeds_revision

I've commented on both.

Also, I've recently started making PRs, but not putting them into needs-review until the CI has passed. Maybe consider doing this too? It's saved me from a few problems on this kind of thing in the past week.

comment:6 Changed 5 weeks ago by dgoulet

Status: needs_revisionneeds_review

Fixed in both. Going afk so taking a chance on this one ;).

comment:7 Changed 5 weeks ago by nickm

Appears correct; let's see what CI says.

comment:8 Changed 5 weeks ago by nickm

Keywords: asn-merge added
Status: needs_reviewmerge_ready

CI has passed.

comment:9 Changed 5 weeks ago by nickm

Keywords: 042-must added

comment:10 Changed 5 weeks ago by asn

Keywords: asn-merge removed
Milestone: Tor: 0.4.2.x-finalTor: 0.4.1.x-final

Merged. adjusting milestone for backports.

comment:11 Changed 4 weeks ago by teor

Keywords: 029-backport added

comment:12 Changed 4 weeks ago by nickm

Resolution: fixed
Status: merge_readyclosed

Merged to 0.2.9 and forward.

Note: See TracTickets for help on using tickets.