-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
refs #11928 / refs #10045 / fixes #11794 - generate limits.h
/climits
defines from platform
#5414
Conversation
ac3be5a
to
fa29f38
Compare
fa29f38
to
e57c9d5
Compare
e57c9d5
to
3cd560c
Compare
The defines generated by The external scripts/logic should at some point be inlined into Cppcheck so you would only have to specify the compiler and no more other files. See https://trac.cppcheck.net/ticket/8956 about that. |
3cd560c
to
e9e66fc
Compare
I don't know to to make the warnings in the added |
e9e66fc
to
7dda08a
Compare
@chrchr-github Any pointers on what to do here? |
There is a |
That was obvious. I did not look at the code at all before. Unfortunately that once again uses custom preprocessing which does not match the production one. That code is also redundant as hell so I will clean that up first. |
limits.h
/climits
defines from platform
92ddc99
to
9d2ef05
Compare
|
||
int main(void) | ||
{ | ||
PRINT_DEF(FLT_RADIX, d); |
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.
What is the purpose of this? Is it the purpose that users will compile and run it? As far as I know this approach will not work in a avr controller for instance. Maybe an alternative would be to just preprocess a file with the target compiler.
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.
What is the purpose of this?
It has multiple purposes:
- for testing/development
- for invoking via the add
run_cppcheck.sh
(not yet integrated / for developers/advanced user) - for invoking via the proposed
--compiler=
option (https://trac.cppcheck.net/ticket/8956) to generate a whole "native" configuration for the analysis instead of relying on a fixed platform configuration (basically integrating the aforementioned script)- this could also be used used to generate some kind of project file/fixed configuration which holds all these information which could be generated once in cases where the compiler or related development files are not available (the avr8 case you mentioned)
This is very much WIP and will probably stay like this for quite a while but we gotta start somewhere. 😀
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.
hmm I am a bit skeptic about merging this into the repo because of all the tools files.
If it's just something we are looking at in the near future and it will just be lying in the repo unused a year from now then it feels unfortunate.
The bash scripts are not portable.
And the solution for #8956 should be generic imho. It should be possible to use it to configure AVR/etc compiler defines.
How about breaking out the tools files into a separate PR ?
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.
If the float.c is not executed.. only preprocessed. Then it can be used for embedded compilers also. My guess is that most compilers have a flag to only perform preprocessing.
Example usage would be:
<my-compiler> <preprocess-only flag> floats.c > compiler-defs.h
cppcheck --compiler-defs=compiler-defs.h ..
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.
How about breaking out the tools files into a separate PR ?
I would like to keep those together with the changes I did for the code and I based those on that output.
If it's just something we are looking at in the near future and it will just be lying in the repo unused a year from now then it feels unfortunate.
The bash scripts are not portable.
And the solution for #8956 should be generic imho. It should be possible to use it to configure AVR/etc compiler defines.
There's lots of unused and possibly broken stuff in the repo nobody has touched in years. Some of it is even being shipped in the official release. This is not to be part of the official distribution and it's the very first step - I am not sure how the next even looks like. ALso having the already finished parts available enabled other people to take a look.
Even though this isn't portable daca isn't either. And I think the first to integrate this with would be daca. But there's several other things I want to finish up first before taking a stab at that.
If the float.c is not executed.. only preprocessed.
That's a good point. So no compilation/execution is needed. I will adjust that in an upcoming PR.
yes I realize that. Probably most of it was added by me myself.
then I understand why you wrote bash scripts at least. |
9d2ef05
to
a92d72b
Compare
I have no idea why I even mentioned that - it's a really bad argument - heck, it's not an argument at all. 😉 |
9271570
to
c5fa742
Compare
c5fa742
to
41114b6
Compare
ok I hope this is work in progress and proper cleanup fixing will be added later.. |
You and me both. I am getting so sick that the local branches keep piling up... |
This also (partially) fixes https://trac.cppcheck.net/ticket/10155. |
No description provided.