From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753602AbbKJPDl (ORCPT ); Tue, 10 Nov 2015 10:03:41 -0500 Received: from 195-154-87-184.rev.poneytelecom.eu ([195.154.87.184]:44100 "EHLO gaby.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753005AbbKJPDk (ORCPT ); Tue, 10 Nov 2015 10:03:40 -0500 Date: Tue, 10 Nov 2015 16:03:32 +0100 From: Gabriel Laskar To: Mikko Rapeli Cc: Alexander Stein , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 02/79] scripts/headers_compile_test.sh: compile test script for exported headers Message-ID: <20151110160332.2ecbe225@lse.epita.fr> In-Reply-To: <2701572.2qlRK3qY0P@ws-stein> References: <1444888618-4506-1-git-send-email-mikko.rapeli@iki.fi> <1444888618-4506-3-git-send-email-mikko.rapeli@iki.fi> <2701572.2qlRK3qY0P@ws-stein> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mikko, On Thu, 15 Oct 2015 09:17:18 +0200 Alexander Stein wrote: > On Thursday 15 October 2015 07:55:40, Mikko Rapeli wrote: > > Users of kernel header files would be happier if they did not > > contain kernel specific parts and would contain #include statements > > for all other header files that they depend on, and in general > > would compile. > > > > For each header file exported to userspace, this script creates > > a simple .c file which just includes the header file. Then it > > tries to compile it together with minimal header files from GCC > > and libc, and reports results. > > Just an idea: Why not try to create a pre-compiled header (pch) > instead. So you can get rid of creating temporary .c files for each > header. I am working on exactly the same thing, here is my suggestions for this: * you can use -fsyntax-only in order to avoid file creation, it will be faster, and don't clutter the directories. * For some headers, for example tegra_drm.h, it is expected to have include drm.h before, so you have to maintain a list of the headers that should be included before each headers. * finally I don't think that including stdint.h/stddef.h is the right solution when a header is using types like size_t or uint32_t, fixing the headers to user __kernel_size_t and __u32 should be cleaner. -- Gabriel Laskar