[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #27185 [Core Tor]: test/test.c and lround() prototype



#27185: test/test.c and lround() prototype
------------------------------+---------------------------------
 Reporter:  gvanem            |          Owner:  (none)
     Type:  defect            |         Status:  new
 Priority:  Medium            |      Milestone:
Component:  Core Tor          |        Version:  Tor: 0.3.4.6-rc
 Severity:  Minor             |     Resolution:
 Keywords:  clang-cl warning  |  Actual Points:
Parent ID:                    |         Points:
 Reviewer:                    |        Sponsor:
------------------------------+---------------------------------

Comment (by teor):

 Thanks for reporting this issue.

 Replying to [ticket:27185 gvanem]:
 > First off, I have to express my frustration with this Trac-system.
 Clumsy as hell; the Markdown support is a joke. I'd wish you'd moved to
 Github or Gitlab.

 Trac uses [https://trac.torproject.org/projects/tor/wiki/WikiFormatting
 WikiFormatting], not Markdown.

 We tried to move to our own Gitlab instance, but it didn't work out.

 We accept pull requests at https://github.com/torproject/tor , but please
 also open a minimal trac ticket with a title and link to the pull request.

 > Okay. To the issue. Compiling test/test.c using MSVC-2017 or clang-cl,
 spits out this warning:
 > {{{
 > test.c(42,10):  warning: 'lround' redeclared without 'dllimport'
 attribute: previous 'dllimport' ignored [-Winconsistent-dllimport]
 > long int lround(double x);
 > }}}
 >
 > From MSVC:
 > {{{
 > test.c(42): warning C4273: 'lround': inconsistent dll linkage
 >
 f:\ProgramFiler-x86\WindowsKits\Include\10.0.16299.0\ucrt\corecrt_math.h(520):
 > note: see previous definition of 'lround'
 > }}}

 Our CI uses gcc, otherwise we might have picked up this issue earlier.
 Do you think it would be easy to extend our Appveyor CI config to use
 clang-cl?
 https://github.com/torproject/tor/blob/master/.appveyor.yml

 > For Windows, it's already prototypes as (after C-preprocessing):
 > {{{
 > __declspec (dllimport)
 >   long long __cdecl llround (double _X);
 > }}}
 >
 > Why not use `tor_lround()` instead?
 > Same goes for `fabs()` I guess, but this function is **not** marked with
 `dllimport`!? Seems to be an intrinsic for clang-cl + MSVC.

 Does the warning go away if we use tor_lround() instead?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/27185#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs