Opened 3 years ago

Closed 3 years ago

#21159 closed enhancement (wontfix)

Superfluous Include Statement

Reported by: BenjaminPollak Owned by:
Priority: Very Low Milestone:
Component: Core Tor/Tor Version:
Severity: Trivial Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hi all,

I think the code in /src/test/test_bt_cl.c could be improved by removing line 4, which reads:
#include "orconfig.h"
because line 11 of /src/test/test_bt_cl.c reads:
#include "util.h"
I checked util.h (found in /src/common/), and it already includes the orconfig.h file on line 14.

Would it be appropriate then, to delete line 4 of /src/test/test_bt_cl.c?

Thanks,
Benjamin

Child Tickets

Change History (2)

comment:1 in reply to:  description Changed 3 years ago by cypherpunks

Replying to BenjaminPollak:

Would it be appropriate then, to delete line 4 of /src/test/test_bt_cl.c?

No, because orconfig.h includes feature test macros which must be defined before including system header files.

The other way around (as in removing the orconfig.h include from util.h) could be possible but you'd have to be sure every file that includes util.h has included orconfig.h before it. A quick grep shows 59 inclusions of util.h which would all need to be checked. I'm not sure the amount of work justifies the benefits (if there are any).

comment:2 Changed 3 years ago by dgoulet

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.