Bug: Code analysis settings not saved

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bug: Code analysis settings not saved

1,303 Views
scottm
Senior Contributor II

I just ran into this in MCUX 10.3.  If you go into the code analysis settings and disable problems and then hit 'apply' or 'apply and save', it discards your changes.  To get it to save, you have to also change something else about the entry, like its severity.

The reason I'm disabling a warning is that there seems to be another bug that I haven't noticed before.  For some reason, static variables with file scope are reported as unused function declarations, when they are neither unused nor functions declarations.

Scott

Labels (1)
Tags (1)
0 Kudos
11 Replies

1,131 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Scott,

Do you mean Code Analysis option here? I tried disabling an error then apply and close. next time I see the the change take effect.

pastedImage_1.png

Is there any misunderstanding ? if yes, please send me screenshots/video of how to reproduce your issue. Thus I can check it further.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,131 Views
scottm
Senior Contributor II

Hi,

It started doing it again and this time I captured a video.  This video shows both the problem with the settings not saving, and static variables showing up as unused function declarations.

Regarding the code analysis problem itself, it looks like the problem is the code analyzer not handling typedefs for function pointers correctly.  If I mouse over the uint8_t type, I get this:

Screenshot 2019-04-05 20.29.49.png

If I ctrl-click on uint8_t it takes me to stdint.h like you'd expect.  The definition it's finding is in the old USB stack v5, which is in a folder excluded from this build, and usb_class.h isn't even in the file's include hierarchy.

That's a separate problem from the settings bug, which I'll try to attach a video for.

Scott

0 Kudos

1,131 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Scott,

Seems your feedback includes other questions, If that is a separated question, please create new thread for it.

your 2019-04-05 20-24-36.mp4 is for your original problem, right? If yes,

- how it works if you create a new workspace to test the problem?

- how it works if you rebuild the project after you modifying the setting?

if the problem keep same for above two tests, I need reproduce them anyway, Which demo code you are working with ( link?)? you will test it.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,131 Views
scottm
Senior Contributor II

I tested with a new workspace and the TWRK21F120M hello_world demo and it saved OK.  I switched back to my normal workspace and it saved at least the first time I tried it, and then I switched it from 'info' to 'warning' and tried again and it's back to not saving.

Creating a new workspace every week and re-importing my projects for every little bug isn't really an option.  I'd like to see this one fixed, but it's not a priority for me and if no one's interested I'll drop this one.  I'll go create another thread for the code analysis bug, which is the more annoying one.

Scott

0 Kudos

1,131 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Scott,

So the project in a clean workspace works normal.

Eclipse maintains many settings and history files inside the workspace .metadata folder. I wonder some files in this folder get messy. To test it, we can remove .metadata folder in this workspace then try again. If you don't want to lost workspace setting, use this tip to export/import workspace settings.

Copy my workspace settings | MCU on Eclipse 

To find the root cause of your issue, we have to reproduce it first. If you get the steps of how to reproduce the problem starting from a clean workspace. Please let me know. I will investigate it further.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,131 Views
scottm
Senior Contributor II

If I figure out how to cause it repeatably from a fresh workspace, I'll let you know.  I have limited time to hunt it down right now.  I figured this would be an easy fix, just something missing a check for a changed item, but it sounds like there's more than that going on.

Scott

0 Kudos

1,131 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

OK, If you find out how to reproduce the issue, please let me know. Thanks.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,131 Views
scottm
Senior Contributor II

That's the one.  Only today it's working correctly - no trouble at all saving settings.  AND the problem with static variables showing up as unused function declarations has gone away.  That's bizarre.  I spent probably 15 minutes trying to figure that out yesterday and I have no idea what might have changed.  I'll let you know if it comes back.

Can the code analysis be run from the command line?  Does it generate a diagnostic output?

Thanks,

Scott

0 Kudos

1,131 Views
converse
Senior Contributor V

If you don't mind spending money, PC-Lint is a very comprehensive C/C++ static analysis tool, that can be run from the command line.

0 Kudos

1,131 Views
scottm
Senior Contributor II

I was only talking about running it from the command line for the sake of troubleshooting its output.  It's working well enough now.  And I've looked at PC-Lint before, but the built-in analyzer has been generally good enough for my needs.

0 Kudos

1,131 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Scott

No, I don't think it can run from command line

Jun Zhang

0 Kudos