0

I'm fighting against the last compiler warnings in a legacy project (MS-COM server, C++-Builder 6), and there are a few warnings left that I ignored previously, because they were raised from generated code for type library stubs (I quote the original German ones, and added a my translation):

[C++ Warnung] utilcls.h(156): W8057 Parameter 'hr' wird nie verwendet.

(parameter 'hr' is never used)

[C++ Warnung] utilcls.h(156): W8057 Parameter 'file' wird nie verwendet.

(parameter 'file' is never used)

I tried "solving it" with local options and pragmas - without success!

Today, I found that the proper solution would be to include ComObj.hpp.

My project uses a set of precompiled headers (collected in one precompiled.h) starting with #include <vcl.h>. The warnings disappear if I include ComObj.hpp before vcl.h, but there are a lot of elements in the project (such as simple tool programs) that have nothing to do with MS-COM...

May it be harmful to include ComObj.hpp in an overall precompiled header set?

Wolf
  • 9,679
  • 7
  • 62
  • 108
  • `// Hopefully we never get here`, that's certainly an appropriate comment. The only thing that's clearly harmful is lousy error reporting. Like not showing the *hr* value or not catching the exceptions that ComObj generates. – Hans Passant Mar 27 '14 at 13:23
  • @HansPassant Yes that's right. And I definitely want to include `ComObj.hpp` in cases where `utilcls.h` is in use. But this header looks very COM specific, so I'm not sure if I be better use two different sets of precompiled headers... – Wolf Mar 27 '14 at 13:34
  • `ComObj.hpp` conflicts with `winsock2.h` ... now I deepen my knowledge about precompiled headers ;) – Wolf Mar 27 '14 at 15:25

0 Answers0