Repository navigation
unusedArgs: bring InstructionAPI into scope itself - #70
Merged
Merged
Conversation
unusedArgs.C uses Instruction unqualified. It only compiles because Dyninst's installed liveness.h has "using namespace Dyninst::InstructionAPI;" at global scope. dyninst/dyninst#2629 removes the using-directives from the installed headers, and with it this file fails to build: unusedArgs.C:74:5: error: 'Instruction' was not declared in this scope Add the using-directive here, next to the file's other ones. It compiles against Dyninst with or without that change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bbiiggppiigg
marked this pull request as ready for review
November 23, 2026 00:53
Collaborator
|
I would prefer to not perpetuate using directives as we're doing in dyninst/dyninst#2629. |
Member
Author
I mean this is in .C file so I think it is fine? |
Collaborator
It's far less bad than in headers, but still not as clear as using explicit namespace prefixes. I guess this PR is fine, but it's a background task I'll add for myself for the non-core repos. |
hainest
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
How we found it
dyninst/dyninst#2629 removes the global-scope using-directives from Dyninst's installed headers. Built against that install, this repository fails in one file:
What is wrong
unusedArgs.CusesInstructionunqualified, but it never bringsDyninst::InstructionAPIinto scope itself. It compiles today only because the installedliveness.hhasusing namespace Dyninst::InstructionAPI;at global scope.How we fixed it
Add
using namespace InstructionAPI;next to the file's other using-directives. The change is backward-compatible: the file builds against Dyninst with or without dyninst/dyninst#2629, so this can merge first.The only other example that includes one of the affected headers,
dataflowAPI/liveness.cpp, already builds against dyninst/dyninst#2629.Validation
On 294a709, all 50 targets built on mahir (x86_64, gcc), with 0 errors and 0 warnings:
Not built on aarch64 or ppc64le; the change has no architecture-specific part.
🤖 Generated with Claude Code