[Mesa-dev] [PATCH] i965: Shut up major()/minor() warnings.

Kenneth Graunke kenneth at whitecape.org
Tue Mar 21 07:19:31 UTC 2017


On Monday, March 20, 2017 9:23:55 PM PDT Jonathan Gray wrote:
> On Mon, Mar 20, 2017 at 04:05:04PM -0700, Kenneth Graunke wrote:
> > Recent glibc generates this warning:
> > 
> > brw_performance_query.c:1648:13: warning: 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>.
> > 
> >     min = minor(sb.st_rdev);
> > 
> > So, include sys/sysmacros.h to shut up the warning.
> 
> This header is only present on glibc so it should be gated by an ifdef
> or it will break all other systems.
> 
> minor()/major() are documented as needing sys/types.h and there is no
> sys/sysmacro.h on OpenBSD for instance.

Gah, thanks...I did a search for sysmacros.h and found some results that
I thought meant that FreeBSD had it.  But, it was actually compatibility
headers for some project trying to build on *BSD...without this.

Will send a v2.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170321/e0394cab/attachment.sig>


More information about the mesa-dev mailing list