
[Paul A. Bristow]
I'm only reporting what it says in http://msdn.microsoft.com/en-us/library/2c8f766e%28v=VS.100%29.aspx "The compiler only supports up to 56 #pragma warning statements in a compiland." I'm not *quite* sure what that means either (or why even?).
I asked Tanveer Gani, our compiler front-end dev lead, and he said that this is simply incorrect: "Maybe "10^" got accidentally deleted? :-) I can't imagine why there'd be a limit for the number of #pragma warnings and the warning state stack uses linked nodes, not a static array." My own experiments have also encountered no such limit. I've filed a bug (DevDiv#122565) telling our doc team to remove this sentence.
But I suspect it explains why this method of warning suppression doesn't always work.
#pragma warning has surprising interactions with templates, and certain codegen warnings must be applied at the level of functions instead of individual statements, but push/disable/pop by itself shouldn't have problems. Stephan T. Lavavej Visual C++ Libraries Developer