Skip to content

Conversation

@jepler
Copy link

@jepler jepler commented Apr 14, 2021

When a function is defined, but its declaration isn't present, the compiler can't check that the declaration and definition match. "-Wmissing-prototypes" enables a diagnostic in this case.

Fixes fall into several categories:

  • Include headers where needed
  • Add/fix declarations / definitions where needed
  • Mark functions as static if appropriate
  • Remove some never-used functions

I ran into problems due to this while working on I2SOut for imxrt10xx, and initially thought I could fix them all and enable the diagnostic generally, but that was over-optimistic. This reduces the number of missing-prototypes diagnostics, but is not complete so -Werror=missing-prototypes is not enabled yet.

 * Include headers where needed
 * Add/fix declarations / definitions where needed
 * Mark functions as static if appropriate
 * Remove some never-used functions

This reduces the number of missing-prototypes diagnostics, but is not
complete so -Werror=missing-prototypes is not enabled yet.
@tannewt tannewt self-requested a review April 14, 2021 19:26
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please enable the warning in the related build files too. Thanks!

#include "supervisor/linker.h"

status_t PLACE_IN_ITCM(flexspi_nor_write_enable)(FLEXSPI_Type * base, uint32_t baseAddr)
status_t PLACE_IN_ITCM(static flexspi_nor_write_enable)(FLEXSPI_Type * base, uint32_t baseAddr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think static needs to be first here. Like below. The macro uses the name in the section name too.

@jepler
Copy link
Author

jepler commented Jun 22, 2021

This was a nice start, but I was unable to find time to finish it.

@jepler jepler closed this Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants