Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #23714

Closed (moved)
Open
Opened Sep 29, 2017 by Taylor Yu@catalyst

stop casting small integers to (void *)

Recently someone on IRC seemed confused about some (void *) variables holding the value (void *)1. Converting integers to pointers is implementation defined, and could create invalid pointers. (Any use of an invalid pointer, including assignment or comparison, is undefined behavior.) In addition, it's confusing to people who are less familiar with C.

Many of these uses seem to involve container types that treat a null pointer as an absence of an entry, but in situations there's no meaningful object to point to if the entry is present. Storing the addresses of small statically allocated objects might be better.

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
Tor: unspecified
Milestone
Tor: unspecified
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#23714