Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1467749

Re: [RFC] Using C99 stdint vs kernel __uX types in kernel drmUAPI (was Re: [PATCH 1/2] Revert "include/uapi/drm/amdgpu_drm.h: use __u32 and __u64 from <linux/types.h>")

From Daniel Vetter <daniel@ffwll.ch>
Newsgroups linux.kernel
Subject Re: [RFC] Using C99 stdint vs kernel __uX types in kernel drmUAPI (was Re: [PATCH 1/2] Revert "include/uapi/drm/amdgpu_drm.h: use __u32 and __u64 from <linux/types.h>")
Date 2016-08-22 17:50 +0200
Message-ID <s8ZE6-89K-25@gated-at.bofh.it> (permalink)
References <s8T5E-3Zg-19@gated-at.bofh.it> <s8UO5-56V-7@gated-at.bofh.it> <s8Yyl-7uQ-9@gated-at.bofh.it> <s8Z1o-7TZ-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Aug 22, 2016 at 04:05:21PM +0100, Emil Velikov wrote:
> On 22 August 2016 at 15:38, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Mon, Aug 22, 2016 at 12:38 PM, Rob Clark <robdclark@gmail.com> wrote:
> >>> That said, _note_ that some applications are built with -C89 -pedantic
> >>> [1] which means that using stdint.h may or may not work as expected.
> >>> So we'll want a __STDC_VESION__ check + #error in case of pre-C99 ?
> >>> If the affected programs are proprietary ones we should be safe,
> >>> otherwise we want to update them ~alongside the transition.
> >>
> >> naw, at least for msm_drm.h, just don't build libdrm_freedreno w/
> >> -C89.. problem solved!
> >
> > Yeah, I think sprinkling an
> >
> > #ifdef __kernel___
> > #include <linux/types.h>
> > #else
> > #include <stdtypes.h>
> > #endif
> >
> Guess i was too vague :-]
> 
> I was thinking about the following cases:
>  - using old/incomplete stdint.h - thus the __STDC_VESION__ check.
>  - building non-libdrm software - for libdrm we've (implicitly and
> explicitly) required C99 for a long time.
> 
> > at the opt of all drm uapi headers should be good enough. Or at least
> > those which opt to choose stdints. Since our userspace is very
> > limited, and our headers will never leak to general applications we
> > can just require c99, at least for driver headers. For kms/general drm
> > uapi that might not be the best idea.
> Won't doing so bring more confusion to an already convoluted topic ?
> If we opt for it, let's have a juicy comment that clarifies things.

If we require C99 in libdrm since ages then I think there's no problem
with outright requiring working stdint support in drm uapi headers
everywhere. We still need a bit of #ifdef though I think to impendence
match between kernel and userspace.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC] Using C99 stdint vs kernel __uX types in kernel drmUAPI (was  Re: [PATCH 1/2] Revert "include/uapi/drm/amdgpu_drm.h: use __u32 and __u64  from <linux/types.h>") Emil Velikov <emil.l.velikov@gmail.com> - 2016-08-22 10:50 +0200
  Re: [RFC] Using C99 stdint vs kernel __uX types in kernel drmUAPI  (was Re: [PATCH 1/2] Revert "include/uapi/drm/amdgpu_drm.h: use __u32 and  __u64 from <linux/types.h>") Christian König <deathsimple@vodafone.de> - 2016-08-22 11:00 +0200
  Re: [RFC] Using C99 stdint vs kernel __uX types in kernel drmUAPI  (was Re: [PATCH 1/2] Revert "include/uapi/drm/amdgpu_drm.h: use __u32 and  __u64 from <linux/types.h>") Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 12:30 +0200
  Re: [RFC] Using C99 stdint vs kernel __uX types in kernel drmUAPI  (was Re: [PATCH 1/2] Revert "include/uapi/drm/amdgpu_drm.h: use __u32 and  __u64 from <linux/types.h>") Rob Clark <robdclark@gmail.com> - 2016-08-22 12:40 +0200
    Re: [RFC] Using C99 stdint vs kernel __uX types in kernel drmUAPI  (was Re: [PATCH 1/2] Revert "include/uapi/drm/amdgpu_drm.h: use __u32 and  __u64 from <linux/types.h>") Daniel Vetter <daniel@ffwll.ch> - 2016-08-22 16:40 +0200
      Re: [RFC] Using C99 stdint vs kernel __uX types in kernel drmUAPI  (was Re: [PATCH 1/2] Revert "include/uapi/drm/amdgpu_drm.h: use __u32 and  __u64 from <linux/types.h>") Emil Velikov <emil.l.velikov@gmail.com> - 2016-08-22 17:10 +0200
        Re: [RFC] Using C99 stdint vs kernel __uX types in kernel drmUAPI  (was Re: [PATCH 1/2] Revert "include/uapi/drm/amdgpu_drm.h: use __u32 and  __u64 from <linux/types.h>") Daniel Vetter <daniel@ffwll.ch> - 2016-08-22 17:50 +0200
  Re: [RFC] Using C99 stdint vs kernel __uX types in kernel drmUAPI  (was Re: [PATCH 1/2] Revert "include/uapi/drm/amdgpu_drm.h: use __u32 and  __u64 from <linux/types.h>") randyf@sibernet.com - 2016-08-22 23:30 +0200

csiph-web