Skip to main content
Singh.Harjit
Senior
November 14, 2018
Question

HAL: Unused parameter warnings

  • November 14, 2018
  • 5 replies
  • 2198 views

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

This topic has been closed for replies.

5 replies

Pavel A.
Super User
November 15, 2018

- Doctor, when I do this, it pains!

- Do not do this.

Singh.Harjit
Senior
November 15, 2018

​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.
Super User
November 16, 2018

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
Senior III
November 16, 2018

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
Technical Moderator
November 16, 2018

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.