Re: [Mesa-dev] [PATCH] i965: Shut up major()/minor() warnings.
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 . For historical compatibility, it is > > currently defined by as well, but we plan to > > remove this soon. To use "minor", include > > directly. If you did not intend to use a system-defined macro > > "minor", you should undefine it after including . > > > > 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. signature.asc Description: This is a digitally signed message part. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965: Shut up major()/minor() warnings.
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 . For historical compatibility, it is > currently defined by as well, but we plan to > remove this soon. To use "minor", include > directly. If you did not intend to use a system-defined macro > "minor", you should undefine it after including . > > 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. > --- > src/mesa/drivers/dri/i965/brw_performance_query.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c > b/src/mesa/drivers/dri/i965/brw_performance_query.c > index 2e04e091d29..17e0d6f0cdf 100644 > --- a/src/mesa/drivers/dri/i965/brw_performance_query.c > +++ b/src/mesa/drivers/dri/i965/brw_performance_query.c > @@ -42,6 +42,7 @@ > #include > #include > > +#include > #include > #include > #include > -- > 2.12.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] i965: Shut up major()/minor() warnings.
Yep, lots of patches like this in Gentoo. Acked-by: Matt Turner___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] i965: Shut up major()/minor() warnings.
Recent glibc generates this warning: brw_performance_query.c:1648:13: warning: In the GNU C Library, "minor" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "minor", include directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including . min = minor(sb.st_rdev); So, include sys/sysmacros.h to shut up the warning. --- src/mesa/drivers/dri/i965/brw_performance_query.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c index 2e04e091d29..17e0d6f0cdf 100644 --- a/src/mesa/drivers/dri/i965/brw_performance_query.c +++ b/src/mesa/drivers/dri/i965/brw_performance_query.c @@ -42,6 +42,7 @@ #include #include +#include #include #include #include -- 2.12.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev