Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.1 KiB

  1. // Copyright (c) 2000 Microsoft Corporation
  2. // the sources file should specify warning level 4. But with warning level
  3. // 4, most of the SDK and CRT headers fail to compile (isn't that nice?).
  4. // So, here we set the warning level to 3 while we compile the headers
  5. #pragma warning(push, 3)
  6. #include <nt.h>
  7. #include <ntrtl.h>
  8. #include <nturtl.h>
  9. #include <windows.h>
  10. #include <ole2.h>
  11. #include <comutil.h>
  12. #include <mmcobj.h>
  13. #pragma warning(pop)
  14. // disable "symbols too long for debugger" warning: it happens a lot w/ STL
  15. #pragma warning (disable: 4786)
  16. // disable "exception specification ignored" warning: we use exception
  17. // specifications
  18. #pragma warning (disable: 4290)
  19. // who cares about unreferenced inline removal?
  20. #pragma warning (disable: 4514)
  21. // we frequently use constant conditional expressions: do/while(0), etc.
  22. #pragma warning (disable: 4127)
  23. // some stl templates are lousy signed/unsigned mismatches
  24. #pragma warning (disable: 4018 4146)
  25. // we like this extension
  26. #pragma warning (disable: 4239)
  27. // Use of pointer types with STL container classes generates this beauty,
  28. // which is a warning because if the situation it warns agains is
  29. // ever encountered, that code will fail to compile.
  30. //
  31. // The problem is that iterator classes define operator-> to return a pointer
  32. // to the element type T of the container. When that element is itself a
  33. // pointer, then the return type of is a pointer to pointer, which has no
  34. // members or methods to invoke. So code like
  35. //
  36. // list<Foo*> l;
  37. // list<Foo*>::iterator i = l.begin();
  38. // i->f();
  39. //
  40. // will not compile, as the type Foo* does not have a method f(). So if the
  41. // code will not compile, why warn about the potential for such code to exist?
  42. #pragma warning (disable: 4284)
  43. // often, we have local variables for the express purpose of ASSERTion.
  44. // when compiling retail, those assertions disappear, leaving our locals
  45. // as unreferenced.
  46. #ifndef DBG
  47. #pragma warning (disable: 4189 4100)
  48. #endif // DBG