- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
I'm compiling my C++ application using icc v. 12, and enabled all warnings to see what the Intel compiler would say about my code. I've got warnings, of course, but some of them didn't make a lot of sense. For example,
warning #2022: Effective C++ Item 12 field member "numeric_kernel::b" not initialized (preferable to assignment in constructors)
For one variable that will be initialized inside the constructor because some calculation has to be done before it is assigned.
Other error:
warning #2012: Effective C++ Item 1 prefer const and inline to #define
#define FUNC_WRAP_H_
where the #define clearly refers to a definition of a .h file.
The last one,
remark #383: value copied to temporary, reference to temporary used
return -Q * z * exp(-I*angle);
inside a class method, where all the variables are members of the class. Can it be just compiler noise?
Thanks!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as the effective C++ warnings are concerned thesewarnings about things that are sometimes bad
programming practice according to Scott Meyer's "Effective C++" book. Seeing a warning here doesn't mean the code isactually bad. I'm sure you'd see similar warnings if you used the -Weffc++ switch with the Gnu compiler.It is not possible for a compilerto get these exactly right, i.e. only issue the warnings on actual bad code.
If they seem to not be useful you should not use the -Weffc++ switch or you can disable the diagnosticsindividually.
The #383 remark is explained in our knowledge base here:
http://software.intel.com/en-us/articles/cdiag383/
This is a remark, not a warning, so it may or may not indicate an actual coding mistake.
Judy

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page