Skip to content

env/io_posix.cc: fix for GCC7 - #17

Closed
smithfarm wants to merge 1 commit into
ceph:masterfrom
smithfarm:wip-major
Closed

smithfarm wants to merge 1 commit into
ceph:masterfrom
smithfarm:wip-major

Conversation

@smithfarm

Copy link
Copy Markdown

GCC7 build fails with 3 errors, all similar to this one:

/home/abuild/rpmbuild/BUILD/ceph-12.0.2+git.1493119152.181baf6/src/rocksdb/env/io_posix.cc:57:13: error: In the GNU C Library, "major" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "major", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"major", you should undefine it after including <sys/types.h>. [-Werror]
if (major(buf.st_dev) == 0) {
^~~~~~~~~~~~~~~~~~~

Signed-off-by: Nathan Cutler [email protected]

GCC7 build fails with 3 errors, all similar to this one:

/home/abuild/rpmbuild/BUILD/ceph-12.0.2+git.1493119152.181baf6/src/rocksdb/env/io_posix.cc:57:13: error: In the GNU C Library, "major" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "major", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"major", you should undefine it after including <sys/types.h>. [-Werror]
   if (major(buf.st_dev) == 0) {
             ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Nathan Cutler <[email protected]>
@smithfarm
smithfarm requested a review from tchaikov April 25, 2017 15:03
@smithfarm

Copy link
Copy Markdown
Author

@tchaikov Compiling latest ceph master with GCC7 yields a number of errors. Currently working on it.

@tchaikov

Copy link
Copy Markdown

strange enough, i am using 7.0.1 on daily basis. this build error sounds weird. and my sysmacros.h also defines major and minor macros. lemme dig a little bit to understand this better tmr also.

@smithfarm

Copy link
Copy Markdown
Author

Note: I have not verified that this fixes the error - I just threw it out here.

The error happens on openSUSE Tumbleweed.

@smithfarm

Copy link
Copy Markdown
Author

@badone badone left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov

Copy link
Copy Markdown

oic, my glibc is still 2.24.

@tchaikov

Copy link
Copy Markdown

will send a PR to pick up the upstream's change.

@tchaikov

Copy link
Copy Markdown

@smithfarm and @badone meta#14818

smithfarm pushed a commit to SUSE/ceph that referenced this pull request Apr 27, 2017
to avoid warning with glibc 2.25, see
meta/rocksdb#2208 and
ceph/rocksdb#17

Signed-off-by: Kefu Chai <[email protected]>
(cherry picked from commit d89318266953ac8b8df4d720091d26f461e6aa60)

Note: fixes bsc#1025891
tchaikov added a commit to tchaikov/ceph that referenced this pull request Apr 27, 2017
to avoid warning with glibc 2.25, see
meta/rocksdb#2208 and
ceph/rocksdb#17

Signed-off-by: Kefu Chai <[email protected]>
smithfarm pushed a commit to SUSE/ceph that referenced this pull request Apr 27, 2017
to avoid warning with glibc 2.25, see
meta/rocksdb#2208 and
ceph/rocksdb#17

Signed-off-by: Kefu Chai <[email protected]>
(cherry picked from commit c891d63)
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.

3 participants