Comments (5)
The idea is good, but we should solve syntax and wrong usage:
Possible syntaxes:
root struct Root { ... };
struct root Root { ... };
main struct Root { ... };
struct main Root { ... };
rootstruct Root { ... };
mainstruct Root { ... };
root Root;
struct Root { ... };
main Root;
struct Root { ... };
struct Root^ { ... };
Wrong usage:
root struct MarkedRoot
{
uint32 value;
};
struct Structure
{
MarkedRoot markedRoot; // marked root is used, what to do? warning?!
}
from zserio.
Initial idea was to use something like
root struct Element1
{}
The above would not throw the warning for unused element. But the element itself could of course be reused by other structs. So basically there would be no "wrong usage" at all.
from zserio.
We think that the root
keyword isn't consistent enough. For example, it seems very strange to have root const string ID = "Zserio"
, or root subtype int32 MySubtype
. And also for users it might be difficult to keep in mind which entities can be "root" - e.g. sql_database
or service
are always "root".
Therefore we propose to introduce new command line option -> -withUnusedWarnings
/ -withoutUnusedWarnings(default)
. Then the user can just run the tool with -withUnusedWarnings
to check which types are not used. In future, we could add something like "unusedWarningsBlackList" to suppress the warning for types which are supposed to be "root". This solution will not do mess in the language.
from zserio.
OK, I agree. So the default would be that the tool does not provide the unused warnings. Only if you explicitly turn it on. Sounds good!
from zserio.
yes, by default you get no unused warnings
from zserio.
Related Issues (20)
- Improve byte aligned reading for strings and bytes
- Investigate GitHub analysis tool which can check Autosar C++
- New keywords for compatibility: removed, deprecated
- Add method to retrieve enum value from enum string directly HOT 3
- HTML: Adhere to multi-line indention in zserio file HOT 2
- Implement warning for invalid unicode characters
- Python `fromJsonString` fails when `integer` is used instead of `float`
- Provide test coverage statistics in release assets HOT 3
- Add clang-tidy to the C++ static code analysis HOT 2
- Documentation on when C++ exceptions are thrown HOT 1
- Consider to check read JSON representation for completeness HOT 1
- Consider to implement warning for optional fields with default value
- Solve clang-tidy: bugprone-exception-escape in generated code
- zserio logo not suitable for dark mode. HOT 1
- Dangling pointer after move/copy constructor of dynamic bit field arrays
- How to mapping blob column after 2.9.0 HOT 2
- Improve C++ runtime test coverage HOT 1
- Consider to remove cppcheck static analysis tool HOT 2
- Fix C++ warning in generated SQL table code with validation
- Unused import in generated Python code
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 zserio.