[SERVER-29855] Pull major/minor from sys/sysmacros.h on linux Created: 26/Jun/17  Updated: 30/Oct/23  Resolved: 26/Jun/17

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.5.10

Type: Bug Priority: Minor - P4
Reporter: Mira Carey Assignee: Mira Carey
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4, v3.2
Sprint: Platforms 2017-07-10
Participants:

 Description   

Per newer versions of glibc:

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]
string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev)

Including <sys/sysmacros.h> appears to be the correct solution to quiet the warning



 Comments   
Comment by Githook User [ 16/Oct/17 ]

Author:

{'email': 'jcarey@argv.me', 'name': 'Jason Carey', 'username': 'hanumantmk'}

Message: SERVER-29855 Pull major/minor from sys/sysmacros.h

Per newer versions of glibc:


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]
string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev)


Including <sys/sysmacros.h> appears to be the correct solution to quiet
the warning

(cherry picked from commit e245cac2b3c18015dee8caddd449532785d15c2b)
Branch: v3.0
https://github.com/mongodb/mongo/commit/235a680d55839e9a6750de13bfe051e9c50d0240

Comment by Githook User [ 02/Oct/17 ]

Author:

{'email': 'jcarey@argv.me', 'name': 'Jason Carey', 'username': 'hanumantmk'}

Message: SERVER-29855 Pull major/minor from sys/sysmacros.h

Per newer versions of glibc:


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]
string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev)


Including <sys/sysmacros.h> appears to be the correct solution to quiet
the warning

(cherry picked from commit e245cac2b3c18015dee8caddd449532785d15c2b)
Branch: v3.4
https://github.com/mongodb/mongo/commit/a591ea35475134f982ccc461fa966ec6ae48b634

Comment by Githook User [ 02/Oct/17 ]

Author:

{'email': 'jcarey@argv.me', 'name': 'Jason Carey', 'username': 'hanumantmk'}

Message: SERVER-29855 Pull major/minor from sys/sysmacros.h

Per newer versions of glibc:


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]
string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev)


Including <sys/sysmacros.h> appears to be the correct solution to quiet
the warning

(cherry picked from commit e245cac2b3c18015dee8caddd449532785d15c2b)
Branch: v3.2
https://github.com/mongodb/mongo/commit/65507e2a2a3fecdd726415bb05dc624d1fcaa63b

Comment by Andrew Morrow (Inactive) [ 22/Sep/17 ]

Hi hydrapolic - I've just now marked this ticket for backport to request backport to 3.2 and 3.4. We will evaluate whether to do the backport the next time we triage open backport requests.

Comment by hydrapolic [ 22/Sep/17 ]

Can you please backport to 3.2/3.4?

Comment by Githook User [ 26/Jun/17 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'jcarey@argv.me'}

Message: SERVER-29855 Pull major/minor from sys/sysmacros.h

Per newer versions of glibc:


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]
string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev)


Including <sys/sysmacros.h> appears to be the correct solution to quiet
the warning
Branch: master
https://github.com/mongodb/mongo/commit/e245cac2b3c18015dee8caddd449532785d15c2b

Generated at Thu Feb 08 04:21:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.