Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#2689 closed defect (fixed)

Compiler warning when building Tor under clang/LLVM

Reported by: sjmurdoch Owned by:
Priority: Very Low Milestone:
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Keywords: tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

With Git master (26009a3), building Tor under clang generates a compiler warning:

rendclient.c:407:3: warning: expression result unused [-Wunused-value]

(int) hid_serv_get_responsible_directories(responsible_dirs, desc_id);

I presume the problem is the int cast, but it seems to do nothing so is there a reason to include it in the first place?

Child Tickets

Change History (9)

comment:1 Changed 9 years ago by Sebastian

Yes, this looks indeed like a superfluous cast. In the past we used to check the return value of hid_serv_get_responsible_directories(), but now we don't need to anymore. This was likely supposed to be either a (void) cast or something else. Does removing the (int) fix the compile warning? If so, that sounds like the best way forward. See svn commit r13258 (git ba7a37cf9) for the change.

comment:2 Changed 9 years ago by Sebastian

Status: newneeds_review

Fix in branch bug2689 in my repo (fix on 0.2.2.x)

comment:3 Changed 9 years ago by Sebastian

Milestone: Tor: 0.2.2.x-final

(I tested the fix, it works)

comment:4 Changed 9 years ago by rransom

Milestone: Tor: 0.2.2.x-finalTor: 0.2.1.x-final

This cast is present on maint-0.2.1 HEAD and should be removed there as well.

comment:5 Changed 9 years ago by arma

Looks fine to me as well.

comment:6 Changed 9 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Trivially correct; cherry-picked back to maint-0.2.1 and merged forward.

comment:7 Changed 7 years ago by nickm

Keywords: tor-relay added

comment:8 Changed 7 years ago by nickm

Component: Tor RelayTor

comment:9 Changed 7 years ago by nickm

Milestone: Tor: 0.2.1.x-final

Milestone Tor: 0.2.1.x-final deleted

Note: See TracTickets for help on using tickets.