From patchwork Fri Aug 7 20:27:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Dudka X-Patchwork-Id: 40013 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n77KTaPO009255 for ; Fri, 7 Aug 2009 20:29:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933707AbZHGU1k (ORCPT ); Fri, 7 Aug 2009 16:27:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932567AbZHGU1j (ORCPT ); Fri, 7 Aug 2009 16:27:39 -0400 Received: from mx2.redhat.com ([66.187.237.31]:38643 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933755AbZHGU1h (ORCPT ); Fri, 7 Aug 2009 16:27:37 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n77KRcs5029832 for ; Fri, 7 Aug 2009 16:27:38 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n77KRbHV022144 for ; Fri, 7 Aug 2009 16:27:38 -0400 Received: from vpn1-4-53.ams2.redhat.com (vpn1-4-53.ams2.redhat.com [10.36.4.53]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n77KRaRr003873 for ; Fri, 7 Aug 2009 16:27:37 -0400 From: Kamil Dudka To: sparse Subject: [PATCH] make sparse headers self-compilable... Date: Fri, 7 Aug 2009 22:27:08 +0200 User-Agent: KMail/1.9.7 MIME-Version: 1.0 X-Length: 4198 X-UID: 38261 Message-Id: <200908072227.08652.kdudka@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org Hello, attached is another fix for SPARSE headers improving their sanity. I am also attaching a simple test for the dependency tracking of headers. It's not enough generic and portable and therefore not really useful. Maybe someone skilled in writing makefiles might want to include something like that to the SPARSE Makefile as part of the 'check' target. Kamil From 8ffbb46652f69e662ce39c135f1867599c0f5477 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 7 Aug 2009 21:48:44 +0200 Subject: [PATCH] make sparse headers self-compilable... ... and thus possible to include them in arbitrary order and without any external dependencies. Signed-off-by: Kamil Dudka --- compile.h | 2 ++ flow.h | 2 ++ ptrlist.h | 2 ++ scope.h | 2 ++ storage.h | 2 ++ 5 files changed, 10 insertions(+), 0 deletions(-) diff --git a/compile.h b/compile.h index 0db8fdb..6c5260d 100644 --- a/compile.h +++ b/compile.h @@ -1,6 +1,8 @@ #ifndef COMPILE_H #define COMPILE_H +#include "symbol.h" + extern void emit_one_symbol(struct symbol *); extern void emit_unit_begin(const char *); extern void emit_unit_end(void); diff --git a/flow.h b/flow.h index 9f2e165..241f081 100644 --- a/flow.h +++ b/flow.h @@ -1,6 +1,8 @@ #ifndef FLOW_H #define FLOW_H +#include "symbol.h" + extern unsigned long bb_generation; #define REPEAT_CSE 1 diff --git a/ptrlist.h b/ptrlist.h index dae0906..85b23fc 100644 --- a/ptrlist.h +++ b/ptrlist.h @@ -7,6 +7,8 @@ * (C) Copyright Linus Torvalds 2003-2005 */ +#include + #define container(ptr, type, member) \ (type *)((void *)(ptr) - offsetof(type, member)) diff --git a/scope.h b/scope.h index 5f1f232..aff7b6b 100644 --- a/scope.h +++ b/scope.h @@ -9,6 +9,8 @@ * Licensed under the Open Software License version 1.1 */ +#include "symbol.h" + struct scope { struct token *token; /* Scope start information */ struct symbol_list *symbols; /* List of symbols in this scope */ diff --git a/storage.h b/storage.h index 610cbfd..0d3bbc5 100644 --- a/storage.h +++ b/storage.h @@ -1,6 +1,8 @@ #ifndef STORAGE_H #define STORAGE_H +#include "lib.h" + /* * The "storage" that underlies an incoming/outgoing pseudo. It's * basically the backing store for a pseudo, and may be a real hardware -- 1.6.3.3