Comments (2)
To give some more detail, the responsible code is here: https://github.com/jessevdk/cldoc/blob/master/cldoc/tree.py#L305
Normally what happens is that functions returning a particular struct type are moved under that struct's page. This is loosely inspired by godoc, but is obviously wrong for C functions. There are actually two bugs in that code. The first assumes that every typedef is a struct-like thing. The second is to give priority to the return type over the first argument type. Maybe a better heuristic for the behavior is that only functions Type* type_new(...)
are moved under Type.
Having said all that, I'm not sure about using any kind of non-trivial heuristic, since there will always be cases for which the heuristic doesn't work. Open to ideas.
from cldoc.
Would it make sense to check for common alloc idioms (init, alloc, create, new) and give functions with those precedence for the return type, and associate other functions with the first parameter?
Type* type_new(Foo *param);
This would correctly associate the previous function with the right type, but prevent functions that return types but are part of another "type".
Of course this wouldn't hit everything, but might catch a good amount.
from cldoc.
Related Issues (20)
- Not recognizing function parameters and returns HOT 2
- Install on Arch linux fails HOT 10
- ValueError: Unknown cursor kind 601 on macOS HOT 3
- Errors when including <cstdint> HOT 2
- Support C variable arguments HOT 2
- ValueError: Unknown type kind 119 (Mac OS X Sierra)
- Unknown type kind HOT 4
- Clang 3.9 incompatibilities HOT 2
- 'friend class Bar' causes "ValueError: Unknown template argument kind 603" HOT 2
- Not working with Python3 HOT 3
- ubuntu 17.10 problem library problem with 1.11 latest release HOT 2
- TypeError: expected a string or other character buffer object HOT 2
- Passing linker arguments into cldoc is broken
- Unable to match comments if a macro is expanded before the declaration.
- Failed to run on Ubuntu 18.04 LTS HOT 6
- how to generate documentation from folder tree HOT 1
- python 3.5 compatibility HOT 1
- Is this library still maintained? HOT 1
- Links in README.md are broken HOT 1
- Python 3.10 > AttributeError: module 'collections' has no attribute 'MutableMapping'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cldoc.