Build issue with pc386 bsp due to forward declarations and legacy code patterns

Ran into a build issue with pc386 bsp

Using following config

[DEFAULT]
RTEMS_POSIX_API = True
OPTIMIZATION_FLAGS = -Wpedantic -Wno-error
[i386/pc386]

On inspecting the affected file bsps/i386/pc386/console/vgainit.c

The file has forward declarations like:

static REGIO graphics_on[];
static REGIO graph_off[];

These are later defined with initializers in the same file, but modern compilers treat the earlier lines as incomplete definitions, which causes build errors (e.g., “array size missing”).

Removing the declarations leads to “undeclared” errors since the arrays are used before definition.

This looks like a legacy code pattern that newer toolchains reject.

Can you open an issue on gitlab?

I have opened an issue on gitlab.

We use this pattern in a number of places. I seem to remember @JoelSherrill mentioning we may have to explicitly turn off the related warning.

I was trying to fix the error related to B0 parity handling and it required the flags so this error was detected.
I have the fix ready but then it would not be tested as the bsp cant be build with pedantic and no error flags