Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #2696

Closed (moved)
(moved)
Open
Created Mar 09, 2011 by Steven Murdoch@sjm217

Tor doesn't compile under LLVM/clang with --enable-gcc-warnings

A Tor default build builds cleanly under LLVM/clang (since bug #2689 (moved) was fixed). However, it does not build cleanly with --enable-gcc-warnings set during ./configure. This is for two reasons:

  1. configure sets CFLAGS to include -Wnormalized=id -Woverride-init, which do not exist in clang 2.9

  2. -Wshorten-64-to-32 is set, which triggers a warning in geoip.c

geoip.c:437:33: warning: implicit conversion loses integer precision: 'long' to 'unsigned int' [-Wshorten-64-to-32] ent->last_seen_in_minutes = now / 60; geoip.c:441:33: warning: implicit conversion loses integer precision: 'long' to 'unsigned int' [-Wshorten-64-to-32] ent->last_seen_in_minutes = now / 60;

I've attached a patch which fixes (1). If clang is being used, and the version is <= 2.9, -Wnormalized=id -Woverride-init are not set. This logic is so that if later versions of clang support these options, we won't disable them for all time without noticing.

I'm not sure if (2) is considered a bug or not. I suppose it will do the wrong thing when time_t is negative, but that was a long time ago.

This is using Tor from Git master (26009a3) on MacOS X 10.6.6.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking