GNU bug report logs - #7099
mbsalign.c old c compiler complains about variables defined inside code

Previous Next

Package: coreutils;

Reported by: Suhan Andrei <sandi_ro <at> yahoo.com>

Date: Fri, 24 Sep 2010 20:31:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 7099 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Suhan Andrei <sandi_ro <at> yahoo.com>
Cc: 7099 <at> debbugs.gnu.org
Subject: Re: bug#7099: mbsalign.c old c compiler complains about variables
	defined inside code
Date: Fri, 24 Sep 2010 22:38:37 +0100
On 24/09/10 21:15, Suhan Andrei wrote:
> Hi
> 
> Just wanted to let you know there are some errors when using old compiler 
> (
> gcc -v
> Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
> gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
> )
> 
> 
> Tere are 2 variables defined inside blocks of code that triggers old c compiler 
> to spill errors.
> I used code from coreutils-8.5.tar.gz 
> I moved declaration at the start of code and all compiled ok.

Eep, I'll fix that up, as we want to keep stuff under gl/
C89 conformant, as it may be moved to gnulib at some stage.

$ LANG=C gcc -std=c89 -pedantic -Werror -c git/coreutils/gl/lib/mbsalign.c -o /dev/null -I git/coreutils/lib/
cc1: warnings being treated as errors
In file included from git/coreutils/gl/lib/mbsalign.c:21:
git/coreutils/gl/lib/mbsalign.h:24: error: comma at end of enumerator list
git/coreutils/gl/lib/mbsalign.c: In function 'mbsalign':
git/coreutils/gl/lib/mbsalign.c:241: error: ISO C90 forbids mixed declarations and code
git/coreutils/gl/lib/mbsalign.c: In function 'ambsalign':
git/coreutils/gl/lib/mbsalign.c:269: error: ISO C90 forbids mixed declarations and code

However I'm confused about how this was the only failure
given this info from README:

***********************
Pre-C99 build failure
-----------------------

There is a new, implicit build requirement:
To build the coreutils from source, you should have a C99-conforming
compiler, due to the use of declarations after non-declaration statements
in several files in src/.  There is code in configure to find and, if
possible, enable an appropriate compiler.  However, if configure doesn't
find a C99 compiler, it continues nonetheless, and your build will fail.
If that happens, simply[*] apply the included patch using the following
command, and then run make again:

  cd src && patch < c99-to-c89.diff

[*] however, as of coreutils-7.1, the "c99-to-c89.diff" file is no longer
maintained, so even if the patches still apply, the result will be an
incomplete conversion.  It's been 10 years.  Get a decent compiler! ;-)

cheers,
Pádraig.




This bug report was last modified 14 years and 238 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.