yourabi / deheader Goto Github PK
View Code? Open in Web Editor NEWdeheader analyzes C and C++ files to determine which header inclusions can be removed while still allowing them to compile.
License: Other
deheader analyzes C and C++ files to determine which header inclusions can be removed while still allowing them to compile.
License: Other
fix: maybe freopen stdin from file?
Some common headers will be automatically pulled into a project indirectly via other headers, for example errno
. Yet, it is good form to explicitly include such headers when making direct use of their symbols.
The current deheader algorithm relies on accidents of indirect inclusion when deciding whether to include a header or not. But a more accurate algorithm would involve scanning for the use of exported symbols.
It would be nice to be able to 'pip install deheader'
Hi,
A common pattern in C/C++ is to define function signatures in a separate .h[pp] file, and then include the signatures into the implementation .c[pp] file. Would be helpful for deheader to account for this common practice.
There may not necessarily be any symbols reused from such a header. Some headers may consist chiefly of a header guard macro and a docstring comment. Yet even so, the implementation conventionally needs to include this header.
Most of the time, the header serves simply to export the implemented functions into a reusable API. The header contains no additional information, but rather acts like a checksum in terms of making sure the function signatures are correct. Although deheader currently treats these headers as removable, in fact, their removal could break the API for downstream users.
For example, drop the file extension from the header basename. Drop the file extension from the implementation basename. If the two match, then it is very likely safe for deheader to ignore this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.