Libraries with S32DS for ARM: strlen and roundf

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

Libraries with S32DS for ARM: strlen and roundf

1,068 Views
Joao_Roscoe
Contributor III

In my project, I need to use roundf and strlen, and I'm getting warnings:

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

warning: incompatible implicit declaration of built-in function 'strlen'

warning: incompatible implicit declaration of built-in function 'roundf'

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

How could I fix that?

Best regards,

Joao

0 Kudos
5 Replies

934 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Joao Roscoe

Those functions are from additional C compiler libraries, they are included in math.h and string.h headers, please add them to your project and verify if you are able to use them now.

Hope this helps
Have a great day,
TIC

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

0 Kudos

934 Views
Joao_Roscoe
Contributor III

Hi, Mr. Vazquez,

Sorry, I'm afraid that I haven't expressed myself properly.

I had already included the libraries and I *am* able to use both "strlen" and "roundf".

However, I keep getting warnings, as posted before, and I can't understand why.

That bothers me, a lot. Warnings won't prevent me from building and testing, but they *are* issues, specially when I cannot undertand them.

I really would like getting rid of those warnings. Still trying.

Best regards,

Joao

0 Kudos

934 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Joao Roscoe

This happens when the program contains code that modifies or replaces some built in functions, in this case strlen is defined by EWL and GCC. If you add #include <string.h>, the waringins should disappear.

Regards

JOrge Alcala

0 Kudos

934 Views
Joao_Roscoe
Contributor III

Unfortunately, I already have both:

#include "string.h" and #include "math.h".

Also tried:

#include <string.h> and #include <math.h>.

And the warnings persist:

-------

implicit declaration of function 'roundf' [-Wimplicit-function-declaration] 

implicit declaration of function 'strlen' [-Wimplicit-function-declaration]

incompatible implicit declaration of built-in function 'roundf'

incompatible implicit declaration of built-in function 'strlen'

-------

Joao

0 Kudos

935 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Joao Roscoe

I'm not able to reproduce the issue that you are facing, could you share the project code, or the file where you get those warining?

Best regards

Jorge Alcala

0 Kudos