Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-9832

minor()/major()/makedev() maro use problems with newer gcc

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.11.0
    • None
    • None
    • 3
    • 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));
                   ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                               

      Attachments

        Activity

          People

            wc-triage WC Triage
            green Oleg Drokin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: