Path: csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod From: Andrew Morton Newsgroups: linux.kernel Subject: Re: [PATCH 04/13] lib/vsprintf.c: expand field_width to 24 bits Date: Wed, 02 Dec 2015 00:40:03 +0100 Message-ID: References: X-Original-To: Rasmus Villemoes X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 29 Organization: linux.* mail to news gateway X-Original-Cc: Tejun Heo , Joe Perches , linux-kernel@vger.kernel.org X-Original-Date: Tue, 1 Dec 2015 15:38:12 -0800 X-Original-Message-ID: <20151201153812.8312aae7ff2b9b20d3fe6c4e@linux-foundation.org> X-Original-References: <1445373013-20207-1-git-send-email-linux@rasmusvillemoes.dk> <1445373013-20207-5-git-send-email-linux@rasmusvillemoes.dk> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1281346 On Tue, 20 Oct 2015 22:30:04 +0200 Rasmus Villemoes wrote: > I didn't find a BUILD_BUG/compiletime_assertion/... which would work > outside function context, so for now I just open-coded it. > It comes up occasionally. It would be better to create one. > +extern char __check_printf_spec[1-2*(sizeof(struct printf_spec) != 8)]; Maybe something like /* * Description goes here */ #define BUILD_BUG_ON_STATIC(unique_id, expr) \ typedef char unique_id[1-2*(expr)]; BUILD_BUG_ON_STATIC(__check_printf_spec, sizeof(struct printf_spec) != 8); ("static" seems the wrong term, but what is the correct term for "outside of functions"?) (I hope this patchset is still up-to-date) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/