[dpdk-dev] [EXT] Re: [PATCH] tracepoint: fix compilation with C++

Sunil Kumar Kori skori at marvell.com
Thu Aug 6 08:44:01 CEST 2020


Hello Pawel, 

See answers inline.

Regards
Sunil Kumar Kori

>-----Original Message-----
>From: David Marchand <david.marchand at redhat.com>
>Sent: Wednesday, August 5, 2020 1:30 PM
>To: Pawel Wodkowski <pawelwod at gmail.com>
>Cc: dev <dev at dpdk.org>; Jerin Jacob Kollanukkaran <jerinj at marvell.com>;
>Sunil Kumar Kori <skori at marvell.com>
>Subject: [EXT] Re: [dpdk-dev] [PATCH] tracepoint: fix compilation with C++
>
>External Email
>
>----------------------------------------------------------------------
>Hello Pawel,
>
>Thanks for contributing to DPDK.
>
>
>On Tue, Aug 4, 2020 at 7:52 PM Pawel Wodkowski <pawelwod at gmail.com>
>wrote:
>>
>> trace_mem is declared as 'void *' which triggers following error:
>> '...invalid conversion from ‘void*’ to ‘__rte_trace_header*’
>> [-fpermissive]...'
>>
>> Fix this by changing void to struct __rte_trace_header

trace_mem is intentionally kept as void * so that it can not be accessed by application directly as it part of global header.
If I understood the problem correctly, it is because of using trace_mem without typecasting and GCC does not report it as error
due to implicit typecast and G++ reports it as error as it does not do implicit typecasting. 

If this is the case then, I think it is better to typecast the trace_mem where ever it is being used. Anyways that will be safe for both GCC and G++.
@Jerin Jacob Kollanukkaran Please suggest. If you have some thing mind. 

[snippet]
--



More information about the dev mailing list