Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Suppress 'Member was not initialized in this constructor' warning(Code Analysis)
Suppress 'Member was not initialized in this constructor' warning [message #1128293] Mon, 07 October 2013 10:46 Go to next message
Eclipse UserFriend
Hi,

Is it possible to suppress the Code Analysis warning: "Member 'x' was not initialized in this constructor". I know I can turn this type of warning off, but I generally find it useful. I would only like to suppress it for one particular constructor.

The "No break at end of case" warning, for example, can by suppressed by adding a comment:
// no break

That's exactly the kind of solution I'm looking for, since I want to comment, that this variable is intentionally left uninitialized, anyway.

Regards,
Kris
Re: Suppress 'Member was not initialized in this constructor' warning [message #1129116 is a reply to message #1128293] Tue, 08 October 2013 05:54 Go to previous messageGo to next message
Eclipse UserFriend
There is always the possibility to exclude certain resources from this check.
Preferences->C/C++->Code Analysis
Select "Class members should be properly initialized" and then click button "Customize..". In the scope tab you can exclude certain resources.
Re: Suppress 'Member was not initialized in this constructor' warning [message #1129124 is a reply to message #1129116] Tue, 08 October 2013 06:04 Go to previous messageGo to next message
Eclipse UserFriend
Axel Mueller wrote on Tue, 08 October 2013 05:54
There is always the possibility to exclude certain resources from this check.
Preferences->C/C++->Code Analysis
Select "Class members should be properly initialized" and then click button "Customize..". In the scope tab you can exclude certain resources.


Thanks for the quick response, but like I said,
Quote:
I know I can turn this type of warning off, but I generally find it useful. I would only like to suppress it for one particular constructor.


This warning has reminded me to initialize members many times in other places. I wish there was a suppressing comment for this or something Wink

Thanks,
Kris
Re: Suppress 'Member was not initialized in this constructor' warning [message #1130290 is a reply to message #1129124] Wed, 09 October 2013 07:56 Go to previous message
Eclipse UserFriend
Krzysztof Czaiński wrote on Tue, 08 October 2013 12:04
This warning has reminded me to initialize members many times in other places. I wish there was a suppressing comment for this or something

Then you should open a bugzilla request.
Previous Topic:Why this SWT Handler error?
Next Topic:Generated resource conflict
Goto Forum:
  


Current Time: Sat May 24 09:33:41 EDT 2025

Powered by FUDForum. Page generated in 0.04848 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top