---- Le sam., 26 juin 2021 18:20:36 -0400 Paul Dufresne 
<mailto:[email protected]> I wrote ----

>I now think that adding "external" before declarations in .h is the correct 
>solution.

>If they were not mark static already, it is that the value is expected to be 
>shared (being global).

>The solution is *I now think* to add external, and have the real declaration 
>in a unique place, like in main.c.







I can now confirm this is a change in GCC 10 ( from 
https://gcc.gnu.org/gcc-10/changes.html ):

"GCC now defaults to -fno-common.  As a result, global
      variable accesses are more efficient on various targets.  In C, global
      variables with multiple tentative definitions now result in linker errors.
      With -fcommon such definitions are silently merged during
      linking."



More details in:

https://gcc.gnu.org/gcc-10/porting_to.html#common



I am now realizing it can be tedious to rearrage the code to initialize stuff 
only once.

-fcommon could allows us to do the bad thing for some time
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to