[LU-9832] minor()/major()/makedev() maro use problems with newer gcc Created: 04/Aug/17  Updated: 13/Sep/18  Resolved: 17/Aug/17

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.11.0

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

building Lustre tools on Fedora 26 I am getting this warning now:

mcreate.c:82:13: error: In the GNU C Library, "minor" 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 "minor", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "minor", you should undefine it after including <sys/types.h>. [-Werror]
                         dev = makedev(strtoul(optarg, NULL, 0), minor(dev));
             ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                               mcreate.c:82:13: error: In the GNU C Library, "makedev" 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 "makedev", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "makedev", you should undefine it after including <sys/types.h>. [-Werror]
                         dev = makedev(strtoul(optarg, NULL, 0), minor(dev));
             ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                               mcreate.c:85: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]
                         dev = makedev(major(dev), strtoul(optarg, NULL, 0));
             ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                               


 Comments   
Comment by Gerrit Updater [ 04/Aug/17 ]

Oleg Drokin (oleg.drokin@intel.com) uploaded a new patch: https://review.whamcloud.com/28360
Subject: LU-9832 tests: Use sys/sysmacros.h for major/minor/makedev
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: fc59e7db2aa02874c64e27de02402a47592846b8

Comment by Gerrit Updater [ 17/Aug/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/28360/
Subject: LU-9832 tests: Use sys/sysmacros.h for major/minor/makedev
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 650b7450b612943e7ade76434c3be70b06f58f58

Comment by Peter Jones [ 17/Aug/17 ]

Landed for 2.11

Comment by Gerrit Updater [ 13/Sep/18 ]

Minh Diep (mdiep@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33161
Subject: LU-9832 tests: Use sys/sysmacros.h for major/minor/makedev
Project: fs/lustre-release
Branch: b2_10
Current Patch Set: 1
Commit: 02b50a67351e54a7f4563f27363601c2d1cea341

Generated at Sat Feb 10 02:29:40 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.