C++ compatibility of some USDPAA headers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

C++ compatibility of some USDPAA headers

1,502 Views
dmitryslezkin
Contributor II

Hello!

I faced a problem with USDPAA API. Some usdpaa headers such as fman.h and compat.h uses pure C approaches: global variables declarations and implicit type conversions instead of other headers (fsl_bman.h, fsl_qman.h, etc.).

The C++ errors with type conversions can be suppressed with -fpermissive (with warnings remained), but the globals issues linker errors of multiple definition.

Is it planned to fix this incompatibilities in the next SDK version or the recommendation is to strictly use C?

I use T4240RDB target and SDK 1.9.

Thank you.

0 Kudos
Reply
3 Replies

1,394 Views
r8070z
NXP Employee
NXP Employee


Have a great day,

"The main goal of USDPAA is to provide an API, as it provides user space processes access to DPAA functionality via a user space device driver and device oriented C language APIs which are layered upon them." So I do not think it is planned to fix headers incompatibilities to C++ in the next SDK.

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,394 Views
dmitryslezkin
Contributor II

Hi, Serguei,

I know that many embedded apps and entire software systems are written on C and it's good practice.

But, some USDPAA headers (like a lot of linux system C headers) already contains macro #ifdef __cplusplus and all related code for compatibility.

Files mentioned above represents just unclear exceptions which make impossible simple #including this files...

p.s.

Above is only comment.

0 Kudos
Reply

1,394 Views
r8070z
NXP Employee
NXP Employee

At honesty in my last C project I also found mix of header files with #ifdef __cplusplus { extern C... while other provide staff which for C only. It because I constructed what I need using open code from different sources. However I agree it should be avoided in public code.

0 Kudos
Reply