Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark global wayland constant extern #86

Merged
merged 1 commit into from
Feb 7, 2020

Conversation

khardix
Copy link
Contributor

@khardix khardix commented Feb 6, 2020

Without extern, the changed lines are not declarations, but "tentative definitions" (according to GCC man page, option -fcommon). When specified in a header file that is included in more than one .c file, these result in linking failure unless -fcommon is specified.

GCC 10 changed the default from -fcommon to -fno-common, and as such the previous code no longer links properly.

With extern, these lines are considered declarations, and the linking proceeds successfully.

Without `extern`, the changed lines are not declarations,
but "tentative definitions"
(according to GCC man page, option `-fcommon`).
When specified in a header file
that is included in more than one `.c` file,
these result in linking failure unless `-fcommon` is specified.

GCC 10 changed the default from `-fcommon` to `-fno-common`,
and as such the previous code no longer links properly.

With `extern`, these lines are considered declarations,
and the linking proceeds successfully.
@Cloudef Cloudef merged commit 543b6c4 into Cloudef:master Feb 7, 2020
@Cloudef
Copy link
Owner

Cloudef commented Feb 7, 2020

Thanks, merged

@khardix khardix deleted the pr/extern-wayland-globals branch February 7, 2020 09:26
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.

None yet

2 participants