Skip to content

Fix some lint issues in nuttx - #198

Merged
ghaerr merged 1 commit into
ghaerr:masterfrom
Acfboy:fix-lint
Aug 22, 2026
Merged

Fix some lint issues in nuttx#198
ghaerr merged 1 commit into
ghaerr:masterfrom
Acfboy:fix-lint

Conversation

@Acfboy

@Acfboy Acfboy commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Hi, @ghaerr . Could we fix some ci -Werror issue mentioned in apache/nuttx#19912 here?

  • Guard the memplan4 framebuffer subdriver declaration with #if ELKS so it is not an unused variable on non-ELKS builds.
  • Convert the space-indented statements in GdRasterOp to tabs to fix the misleading-indentation warning.
  • Declare FARPROC, NEARPROC and PROC with (void) parameters to fix the strict-prototypes warning.

- Guard the memplan4 framebuffer subdriver declaration with #if ELKS
so it is not an unused variable on non-ELKS builds.
- Convert the space-indented statements in GdRasterOp to tabs to fix
the misleading-indentation warning.
- Declare FARPROC, NEARPROC and PROC with (void) parameters to fix
the strict-prototypes warning.
@ghaerr

ghaerr commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Could we fix some ci -Werror issue mentioned in apache/nuttx#19912 here?

Sure. I can see there's more warnings there than I would have thought. I may clean up some of the others seen when I have time.

Declare FARPROC, NEARPROC and PROC with (void) parameters to fix the strict-prototypes warning.

I don't see any actual uses of FARPROC or NEARPROC, but not fully sure about PROC. In some cases, adding a (void) parameter list could cause problems should their current empty () be required to allow a variety of arguments, but lets go ahead and change this now, as if this issue comes up it can always be changed back.

Thanks!

@ghaerr
ghaerr merged commit 4b45fc3 into ghaerr:master Aug 22, 2026
@ppisa

ppisa commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

As I mention in #194 (comment) , the relatively mild intrusive solution to undefined macros warning is use of the next pragma at start of header files and C files where it is necessary

#pragma GCC diagnostic ignored "-Wundef"

and I expect that large part would be solved by adding it at start of mwconfig.h or it can be put even to mwconfig.nuttx but I think that its use for all targets would be OK and advantage.

@ghaerr

ghaerr commented Aug 26, 2026

Copy link
Copy Markdown
Owner

@ppisa,

#pragma GCC diagnostic ignored "-Wundef"

If this works for NuttX, that's great, lets add it.

it can be put even to mwconfig.nuttx

Since the problem only occurs with the NuttX configuration requiring -Wundef, I would prefer solving the problem using only mwconfig.nuttx, as it seems that the real issue here is that -Wundef is incompatible with the way that Microwindows uses symbols for #if directives. This leaves the rest of the compilations as-is, where no warnings are currently produced.

Please submit a PR if this sounds good.

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.

3 participants