Skip to content

Allow to copy ptrace.c code into C++ codebase#5

Open
arkq wants to merge 3 commits intoelcritch:masterfrom
arkq:patch-1
Open

Allow to copy ptrace.c code into C++ codebase#5
arkq wants to merge 3 commits intoelcritch:masterfrom
arkq:patch-1

Conversation

@arkq
Copy link

@arkq arkq commented May 26, 2023

Changes

  • add extern "C" to allow copying prace.c code into C++ codebase
  • use size_t for reading segment offset (fix void pointer arithmetic)
  • fix reading segment offset on 64-bit architectures

arkq added 3 commits May 17, 2023 11:37
Using void pointers in arithmetic operations is an undefined behavior.
In C++ it triggers compilation errors.

Also, use "%zx" to read segment offset to properly run on 32/64 bit
machines.
This will allow to seamlessly copy the ptrace.c code into the
C++ codebase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant