Bug 754188 - Functions major() and minor() returns unsigned value
Summary: Functions major() and minor() returns unsigned value
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: man-pages
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Schiffer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-15 16:25 UTC by Zdenek Kabelac
Modified: 2012-09-12 10:05 UTC (History)
5 users (show)

Fixed In Version: man-pages-3.41-1.fc18
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-12 10:05:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Zdenek Kabelac 2011-11-15 16:25:20 UTC
Description of problem:

While 'man major' | 'man minor'  is giving me impression it should return 'int' (signed) value, the header file: /usr/include/sys/sysmacros.h is convincing me, I should expect unsigned value:

extern unsigned int gnu_dev_major (unsigned long long int __dev)
     __THROW __attribute_const__;
extern unsigned int gnu_dev_minor (unsigned long long int __dev)
     __THROW __attribute_const__;

# define major(dev) gnu_dev_major (dev)
# define minor(dev) gnu_dev_minor (dev)

Is there any good reason to have this  incompatibility?
(Well the gcc is giving sign warning - and I think we should probably follow the common UNIX definition here ?)


Version-Release number of selected component (if applicable):
glibc-headers-2.14.90-15.2.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jeff Law 2011-12-08 06:31:06 UTC
The man pages are incorrect and need to be updated.  major/minor were never part of the POSIX specification.  In the past they were actually macros and thus took on the types based on the context in which the macros were used and the usual C promotions.

glibc has chosen to more strictly define major/minor which allows programmers to better predict its behavior.

Changing component to man-pages.

Comment 2 Michael Kerrisk 2012-04-29 23:27:36 UTC
Will be fixed in upstream man-pages-3.41.

Comment 3 Peter Schiffer 2012-09-12 10:05:23 UTC
As Michael wrote, this bug was fixed in:
man-pages-3.41-1.fc18
http://koji.fedoraproject.org/koji/buildinfo?buildID=319380


Note You need to log in before you can comment on or make changes to this bug.