From patchwork Mon Aug 10 16:23:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Poselenov X-Patchwork-Id: 40443 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 n7AGlonu026788 for ; Mon, 10 Aug 2009 16:47:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932260AbZHJQrK (ORCPT ); Mon, 10 Aug 2009 12:47:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932261AbZHJQrJ (ORCPT ); Mon, 10 Aug 2009 12:47:09 -0400 Received: from ocean.emcraft.com ([213.221.7.182]:58974 "EHLO ocean.emcraft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932260AbZHJQrI convert rfc822-to-8bit (ORCPT ); Mon, 10 Aug 2009 12:47:08 -0400 X-Greylist: delayed 1397 seconds by postgrey-1.27 at vger.kernel.org; Mon, 10 Aug 2009 12:47:08 EDT Received: from pvr.emcraft.com ([172.17.0.212] helo=localhost.localdomain) by ocean.emcraft.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MaXf4-0005xC-CR; Mon, 10 Aug 2009 20:23:50 +0400 Date: Mon, 10 Aug 2009 20:23:49 +0400 From: Sergei Poselenov To: linux-kbuild@vger.kernel.org Cc: wd@denx.de Subject: [PATCH] modpost: Remove C99 declaration Message-ID: <20090810202349.3ff9c617@emcraft.com> Organization: Emcraft Systems X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; i386-redhat-linux-gnu) Mime-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Hello all, I'm building an off-tree kernel-dependent package (iscsitarget), which results a set of kernel modules. This is a cross-platform build, with a toolchain installed on an old RH7.3 host (host GCC v2.96) Unfortunately, build fails with the following error: -> PATH=/work/psl/e/arm-2009-08-06/work/bin:/work/psl/e/arm-2009-08-06/work/usr/arm-linux/bin:/work/psl/e/arm-2009-08-06/work/usr/bin:$PATH CROSS_COMPILE=arm-linux- make ARCH=arm -C /work/psl/e/arm-2009-08-06/work/arm/usr/src/linux scripts HOSTCC='/usr/bin/gcc -B/usr/bin/' make: Entering directory `/work/psl/e/arm-2009-08-06/work/arm/usr/src/linux-2.6.30.3' HOSTCC scripts/basic/fixdep HOSTCC scripts/basic/docproc HOSTCC scripts/basic/hash HOSTCC scripts/mod/modpost.o scripts/mod/modpost.c: In function `match': scripts/mod/modpost.c:699: parse error before `const' scripts/mod/modpost.c:707: `endp' undeclared (first use in this function) scripts/mod/modpost.c:707: (Each undeclared identifier is reported only once scripts/mod/modpost.c:707: for each function it appears in.) gcc: file path prefix `/usr/bin/' never used make[2]: *** [scripts/mod/modpost.o] Error 1 make[1]: *** [scripts/mod] Error 2 make: *** [scripts] Error 2 make: Leaving directory `/work/psl/e/arm-2009-08-06/work/arm/usr/src/linux-2.6.30.3' -> The origin of the error is obvious - C99 declaration in match(). The patch is trivial: From ddf9724f833c0c7529e868cde4137e31d34ae854 Mon Sep 17 00:00:00 2001 From: Sergei Poselenov Date: Mon, 10 Aug 2009 18:03:07 +0200 Subject: [PATCH] Removed C99 declaration, which breaks build of modpost with old compilers. Signed-off-by: Sergei Poselenov --- scripts/mod/modpost.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 4522948..a496341 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -695,8 +695,9 @@ int match(const char *sym, const char * const pat[]) { const char *p; while (*pat) { + const char *endp; p = *pat++; - const char *endp = p + strlen(p) - 1; + endp = p + strlen(p) - 1; /* "*foo" */ if (*p == '*') {