Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
718 Discussions

Getting warning msg's: "warning : unused typedef 'ThisClass' " on compiling sample MFC based applica

pankaj1982
Beginner
1,862 Views

Hello Intel Team,

 

Can you tell us if there is any way to resolve this MFC warning that I am getting in this sample application attached.

 

1>MFCApplication4Doc.cpp(25,1): : warning : unused typedef 'ThisClass' [-Wunused-local-typedef]
1>BEGIN_MESSAGE_MAP(CMFCApplication4Doc, CDocument)
1>^
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\atlmfc\include\afxwin.h(1262,20): note: expanded from macro 'BEGIN_MESSAGE_MAP'
1> typedef theClass ThisClass;

 

I can supress this warning for now, but i want to get rid of this warning permanently.

Can you tell me how to get rid of it ( and not just suppress it).

 

Find attached the sample program demonstrating this issue.

0 Kudos
6 Replies
RabiyaSK_Intel
Employee
1,839 Views

Hi,


Thanks for posting in Intel Communities.


Could you please provide the following details:

1. OneAPI Toolkit Version

2. Visual Studio version and sub-version

3. Is "warning : unused typedef 'ThisClass' [-Wunused-local-typedef]" the only warning you are receiving? Have you tried building the application in both debug and release mode?


>>>I can supress this warning for now, but i want to get rid of this warning permanently.

How are you suppressing the warnings?


We can suppress your present warning by adding "/Wno-unused-local-typedef" compiler flag in Additional Options of Command Line under C++ in Property Pages. Are you suppressing the warnings the same way? If not please specify the approach.


Thanks & Regards,

Shaik Rabiya

 


0 Kudos
pankaj1982
Beginner
1,837 Views

platform toolset used to build sample: Intel C++ Compiler 2023

I have installed IntelOneApi DPC++/C++ compiler extension in Microsoft Visual Studio 2019.

I downloaded the same from within Visual Studio: Extensions -> Manage Extensions -> Search Intel C++ compilers and download/install the exe by double clicking on it. it will integrate itself with MS VS2019. 

VS version: Microsoft Visual Studio Professional 2019 Version 16.11.20

The warning is coming in both release|debug mode. I can correct the other warnings that are coming but not this one.

Yes, i am suppressing the warning the same way as you have mentioned.

Do you know how to resolve this warning. What if I don't want to suppress this warning but to rectify it.

With MS VS2019 default compiler there is no such warning from this code.

 

Let me know how to correct this warning.

 

------------

Thanks,

Pankaj.

0 Kudos
RabiyaSK_Intel
Employee
1,792 Views

Hi,


We are able to reproduce your issue. We have informed the development team about it. We will get back to you soon.


Thanks & Regards,

Shaik Rabiya


0 Kudos
RabiyaSK_Intel
Employee
1,723 Views

Hi,

 

Thank you for your patience. The warnings which are visible while building the MFC Application in Intel OneApi DPC++/C++ 2023 Compiler is the diagnostic ability of Intel OneApi compilers. 

 

You could suppress these warnings as you've already mentioned. Maybe you could reach out to Microsoft as there is a possibility that they could add markings to their MFC code to ensure that such kind of diagnostics may not be triggered by any compiler and static analysis tool.

 

Thanks & Regards,

Shaik Rabiya

 

0 Kudos
RabiyaSK_Intel
Employee
1,682 Views

Hi,


We have not heard back from you. Could you please respond to my previous post?


Thanks & Regards,

Shaik Rabiya


0 Kudos
RabiyaSK_Intel
Employee
1,644 Views

Hi,


We have not heard back from you. Assuming that your issue is resolved, we are closing this thread. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Shaik Rabiya


0 Kudos
Reply