[tor-bugs] #21826 [Core Tor/Tor]: clang warnings because of "empty" hs_service.c file in 0.3.0

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Mar 27 13:18:15 UTC 2017


#21826: clang warnings because of "empty" hs_service.c file in 0.3.0
--------------------------+------------------------------------
 Reporter:  asn           |          Owner:
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: 0.3.0.x-final
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:  tor-hs        |  Actual Points:
Parent ID:                |         Points:  0.1
 Reviewer:                |        Sponsor:  SponsorR-can
--------------------------+------------------------------------
Description changed by asn:

Old description:

> Currently (in 0.3.0) the code in `hs_service.c` is disabled using '#ifdef
> TOR_UNIT_TESTS` and is only used for unittests. We will remove these
> `#ifdef` guards in 0.3.2 when we merge the rest of the service-side code.
>
> Unfortunately, as it seems having an empty .c file is no good, since
> empty translation units (i.e. files) are undefined behavior in C.
>
> Sebastian pointed this out, and said that his clang is throwing warnings
> at him because of that. He says that compilation proceeds normally, but
> it might be a good thing to fix anyhow.
>
> We could fix this by adding a static variable on top to silence the
> warning, or by removing the #ifdef guards.

New description:

 Currently (in 0.3.0) the code in `hs_service.c` is disabled using `#ifdef
 TOR_UNIT_TESTS` and is only used for unittests. We will remove these
 `#ifdef` guards in 0.3.2 when we merge the rest of the service-side code.

 Unfortunately, as it seems having an empty .c file is no good, since empty
 translation units (i.e. files) are undefined behavior in C.

 Sebastian pointed this out, and said that his clang is throwing warnings
 at him because of that. He says that compilation proceeds normally, but it
 might be a good thing to fix anyhow.

 We could fix this by adding a static variable on top to silence the
 warning, or by removing the #ifdef guards.

--

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/21826#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list