- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Odd behavior with pragmas diag_push/diag_suppr...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2013 02:19 PM
08-26-2013 02:19 PM
Odd behavior with pragmas diag_push/diag_suppress/diag_pop
I'm attempting to silence a warning using diag_push/diag_suppress/diag_pop, however I'm running in to some scenarios where the suppression appears to be getting ignored. The following testcase demonstrates the issue:
template <typename T>
struct A {
#pragma diag_push
void func1();
#pragma diag_pop
};
struct B {
void func2();
#pragma diag_push
#pragma diag_suppress 4285
B& operator=(const B&) {
func2();
return *this;
}
#pragma diag_pop
void* data_;
};
void func() {
A<int> var;
var.func1();
}
When I compile this code, I see the following warning:
aCC +DD64 +w -c testcase.cpp
"testcase.cpp", line 15: remark #4285-D: operator= does not have a check for
the source and destination addresses being non-identical
B& operator=(const B&)
^
If I remove the extra diag_push/diag_pop around func1, or if I repeat the diag_suppress before the assignment operator, the warning is silenced, however it isn't clear to me why that would be necessary. Alternatively, Using diag_suppress/diag_default instead of diag_push/diag_suppress/diag_pop also appears to work correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2013 11:48 PM
08-26-2013 11:48 PM
Re: Odd behavior with pragmas diag_push/diag_suppress/diag_pop
This looks like a bug in the compiler. Can you please get in touch with the response center and file a bug report?
Thanks!
HP-UX Compilers