cancel
Showing results for 
Search instead for 
Did you mean: 

HAL: Unused parameter warnings

Singh.Harjit
Senior II

I compile my code with -Wunused-parameter and I get many "warning: unused parameter …" for the STM32F4 HAL.

Would be great if this can be fixed in the library. I don't want to change the library and then have to maintain the changes.

Thanks!

Harjit

5 REPLIES 5
Pavel A.
Evangelist III

- Doctor, when I do this, it pains!

- Do not do this.

Singh.Harjit
Senior II

​I disagree.

I don't think anyone intentionally adds extra parameters or variables. Which means it is a mistake and so should be fixed.

Pavel A.
Evangelist III

In ideal world, yes. In reality, as we see, ST is not very agile with the libraries - so unlikely you will get this proposal fulfilled in reasonable time frame.

So what? Specify more relaxed checking for code that you don't control.

Specially for this situation, many linters have concept of "library files", that's the code that we do not control and do not want to see noise about it.

Regards,

-- pa

AvaTar
Lead

I need to agree with Pavel. There is no point in complaining about third-party code.

All toolchains I know allow individual settings for files, so enable "-Wall" or whatever for your own sources.

In my company, we use to exclude such third-party code from any lint/Misra checks, for example.

Amel NASRI
ST Employee

Hi @Singh.Harjit​ ,

It is interesting to know with which files do you see such warnings?

If it is related to drivers delivered by ST, we can take the action to fix them.

Otherwise, for drivers coming from third-parties, we can report the errors and let the action at their sides.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.