Re: afxtempl.h compiler warnings



In typical fashion, I discovered a clue shortly after giving up and
soliciting outside help ;)

We're including some auto-generated code from one of our vendors, and
that code contains pop_macro lines regarding the "new" keyword. I see
no corresponding push_macro lines. I think I'm on to something.

Kevin

Kevin wrote:
Hey group!

My development team is working to make the transition from Visual
Studio 6 to Visual Studio 2005. All of our libraries and applications
are compiling and linking (after making many changes along the way),
but we're left with a couple of compiler warnings that we can't make
sense of:

c:\program files\microsoft visual studio
8\vc\atlmfc\include\afxtempl.h(2089): warning C4602: #pragma pop_macro
: 'new' no previous #pragma push_macro for this identifier
c:\program files\microsoft visual studio
8\vc\atlmfc\include\afxtempl.h(2105): warning C4193: #pragma
warning(pop) : no matching '#pragma warning(push)'

These warnings are repeated, it seems, for every #include <afxtempl.h>
that occurs in our code. I understand what the warning means, but I
can't see how the complaint is valid. There are seven occurrences of:

#pragma push_macro("new")

.. in the afxtempl.h header file, and also seven occurrences of:

#pragma pop_macro("new")

Twelve of these occurrences are pairs of push/pop in very close
proximity. This leaves one push at the beginning of the file, and a
corresponding pop at the end.

Not only does the file look fine, but I can't imagine there is
something _actually_ wrong with it -- being such a core piece of MFC
code. I'm not sure where else to look. Usenet, knowledge base and web
searches have, thus far, yielded no information. Please help!

Here is the version information for VS 2005 and .NET:

Microsoft Visual Studio 2005 Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework Version 2.0.50727

This work is being done under Windows XP. Please let me know what other
information to provide -- I've really got no leads to go on at this
point.

Thanks!
Kevin

.



Relevant Pages

  • afxtempl.h compiler warnings
    ... Studio 6 to Visual Studio 2005. ... are compiling and linking, ... 'new' no previous #pragma push_macro for this identifier ...
    (microsoft.public.vc.mfc)
  • Re: Warning c4701 in atl code :(
    ... #pragma warning ... I get the following warning in ATL code: ...
    (microsoft.public.vc.atl)
  • Warning c4701 in atl code :(
    ... I get the following warning in ATL code: ... #pragma push_macro ...
    (microsoft.public.vc.atl)
  • ndis.lib linking problem.
    ... Searching libraries ... Searching C:\Program Files\Microsoft Visual Studio 8\SmartDevices ... asyncmac.obj: error LNK2019: unresolved external symbol ...
    (microsoft.public.windowsce.embedded.vc)
  • ndis.lib linking problem.
    ... Searching libraries ... Searching C:\Program Files\Microsoft Visual Studio 8\SmartDevices ... asyncmac.obj: error LNK2019: unresolved external symbol ...
    (microsoft.public.windowsce.app.development)

Loading