New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add /*<type>*/ annotations everwhere #2986
Conversation
decc642
to
11ee5d3
Compare
Do these function pointers have a specified return type, or should I or remove them (or annotate with |
11ee5d3
to
b14c88b
Compare
@wingdeans annotate with |
b14c88b
to
385a78c
Compare
385a78c
to
35af7d5
Compare
Only errors are due to inconsistencies in rz-hexagon (PR here)
|
@wingdeans what is the status of this PR? Could you please update and rebase it on top of the latest |
35af7d5
to
20ac7f9
Compare
The linter is ready, it just needs rizinorg/rz-hexagon#78 in rz-hexagon to address the emitted warnings. |
There are a lot of non-comment changes, for generic types I couldn't infer the specializations for since they weren't being used. |
why you are exporting plugin headers? the only headers that should be exported are those in the |
@wingdeans yes, step by step. Having the linter opens the potential to improve the inference and detection. |
The goal is to add type annotations everywhere and make sure that they are consistent between definition and declaration, with the linter checking this. I can take them out if it's too much but I think it's useful for development (and maybe adding actual typechecking in the future). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup
@wingdeans LGTM, but please rebase and fix the conflicts. |
Adds /*<type>*/ comments and a linter check from rz-bindgen to enforce their existence and consistency Also includes the following fixes made when adding the annotations: * removed unused intern_table arguments in pyc_dis.c, pyc_dis.h, asm_pyc.c * removed unused classes argument from place_nodes in agraph.c * removed unused recurse and recurse_bb functions in canalysis.c * removed unused vars field from RzPrint struct * removed unused RzAnalysisType* structs from rz_analysis.h * removed unused list field from RzEgg struct * fixed bug in bp_plugin.c where duplication checking logic iterates over the wrong list * removed unused q_regs field from RzDebug struct * removed unused backtrace field from RzDebugPlugin struct * removed unused classes_list field from RzBinNXOObj struct * removed unused methods_list and classes_list fields from RzBinZimgObj struct
20ac7f9
to
237f5a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets merge this and fix the hexagon issue separately.
I merged it as is then and created a separate issue to fix those warnings: #3020 |
Addresses #2981
Your checklist for this pull request
Detailed description
This commit adds
/*<type>*/
annotations to almost allRzList
,RzVector
,RzPVector
, andRzGraph
occurrences in function declarations. The missing annotations were detected using a libclang python script and the types were then manually added.There are a few non-comment changes which shouldn't affect any functionality. Let me know if I should revert them.
intern_table
arguments inpyc_dis.c
,pyc_dis.h
,asm_pyc.c
classes
argument fromplace_nodes
inagraph.c
recurse
andrecurse_bb
functions incanalysis.c
vars
field fromRzPrint
structRzAnalysisType*
structs fromrz_analysis.h
list
field fromRzEgg
structbp_plugin.c
where duplication checking logic iterates over the wrong listq_regs
field fromRzDebug
structbacktrace
field fromRzDebugPlugin
structclasses_list
field fromRzBinNXOObj
structmethods_list
andclasses_list
fields fromRzBinZimgObj
structTODO
Test plan
The annotations are currently only for developer ergonomics and are not verified in any way. rz-bindgen utilizes them, but only from a limited subset of the headers, so there is no way to verify their correctness.