Skip to content

Conversation

@NGGJamie
Copy link

GCC versions above 10.0 use -fno-common instead of -fcommon. The change in default operation for GCC 10 prevented the project from building because of how the Dev_Random file pointer was defined, as it was being defined multiple times per the compiler.

diatomic-ge added a commit to diatomic-ge/HellCore that referenced this pull request Aug 5, 2022
Previously, there were technically definitions for Dev_Random in both
server.c and numbers.c, as well as everywhere else that included
server.h.

GCC seems to've either been previously correcting or masking this issue,
or perhaps Dev_Random just doesn't get used in practice outside of where
it's set in server.c, so it never had a chance to cause issues.

At some point, GCC switched to not silently merging the conflicting
definitions without -fcommon, which isn't recommended to use in
practice.

Whatever the case, set the declaration in server.h extern, remove
unnecessary declaractions, and actually define Dev_Random in server.c
(to match server.h) so that there is one definition that is referenced
everywhere.

Fixes necanthrope#9
diatomic-ge added a commit to diatomic-ge/HellCore that referenced this pull request Oct 5, 2022
Previously, there were technically definitions for Dev_Random in both
server.c and numbers.c, as well as everywhere else that included
server.h.

GCC seems to've either been previously correcting or masking this issue,
or perhaps Dev_Random just doesn't get used in practice outside of where
it's set in server.c, so it never had a chance to cause issues.

At some point, GCC switched to not silently merging the conflicting
definitions without -fcommon, which isn't recommended to use in
practice.

Whatever the case, set the declaration in server.h extern, remove
unnecessary declaractions, and actually define Dev_Random in server.c
(to match server.h) so that there is one definition that is referenced
everywhere.

Fixes necanthrope#9
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.

1 participant