SHIVAM DEOLANKAR created an issue: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5564



## Summary

More Info regarding this can be viewed from the 
discussion.[Here](https://users.rtems.org/t/build-issue-with-pc386-bsp-due-to-forward-declarations-and-legacy-code-patterns/813)

This is the error observed when building the PC386 with the given configuration 
settings.

```
../../../bsps/i386/pc386/console/vgainit.c:67:25: error: array size missing in 
'graphics_on'
   67 | static REGIO            graphics_on[];
      |                         ^~~~~~~~~~~
../../../bsps/i386/pc386/console/vgainit.c:68:25: error: array size missing in 
'graph_off'
   68 | static REGIO            graph_off[];
      |                         ^~~~~~~~~
In file included from ../../../bsps/i386/pc386/console/vgainit.c:9:
```

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.

## Steps to reproduce

Using following config

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

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5564
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to