GNU bug report logs - #8295
coreutils 8.10 portability fixes

Previous Next

Package: coreutils;

Reported by: Andreas Stolcke <stolcke <at> speech.sri.com>

Date: Sat, 19 Mar 2011 20:04:02 UTC

Severity: normal

Tags: moreinfo, notabug

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8295 in the body.
You can then email your comments to 8295 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8295; Package coreutils. (Sat, 19 Mar 2011 20:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andreas Stolcke <stolcke <at> speech.sri.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sat, 19 Mar 2011 20:04:02 GMT) Full text and rfc822 format available.

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

From: Andreas Stolcke <stolcke <at> speech.sri.com>
To: bug-coreutils <at> gnu.org
Subject: coreutils 8.10 portability fixes
Date: Sat, 19 Mar 2011 12:04:46 -0700
Two sets of fixes:

- Several places where iterator variables are declared inside for(), failing compiles
   on systems that support c99.

- The inclusion of <langinfo.h> has to be protected by 
	#if HAVE_NL_LANGINFO
  instead of 
	#if HAVE_LANGINFO_CODESET
  to match the piece of code later where the langinfo is actually used.

These problems surfaced when building on an old IRIX5.3 system with gcc 3.4.6.

--Andreas

*** src/csplit.c.dist	Mon Jan 31 04:40:38 2011
--- src/csplit.c	Thu Mar 17 20:07:05 2011
***************
*** 1200,1207 ****
  get_format_flags (char const *format, int *flags_ptr)
  {
    int flags = 0;
  
!   for (size_t count = 0; ; count++)
      {
        switch (format[count])
          {
--- 1200,1208 ----
  get_format_flags (char const *format, int *flags_ptr)
  {
    int flags = 0;
+   size_t count;
  
!   for (count = 0; ; count++)
      {
        switch (format[count])
          {
***************
*** 1275,1282 ****
  max_out (char *format)
  {
    bool percent = false;
  
!   for (char *f = format; *f; f++)
      if (*f == '%' && *++f != '%')
        {
          if (percent)
--- 1276,1284 ----
  max_out (char *format)
  {
    bool percent = false;
+   char *f;
  
!   for (f = format; *f; f++)
      if (*f == '%' && *++f != '%')
        {
          if (percent)
*** src/ls.c.dist	Mon Jan 31 04:40:38 2011
--- src/ls.c	Thu Mar 17 20:12:24 2011
***************
*** 60,66 ****
  #include <selinux/selinux.h>
  #include <wchar.h>
  
! #if HAVE_LANGINFO_CODESET
  # include <langinfo.h>
  #endif
  
--- 60,66 ----
  #include <selinux/selinux.h>
  #include <wchar.h>
  
! #if HAVE_NL_LANGINFO
  # include <langinfo.h>
  #endif
  
***************
*** 1036,1044 ****
    size_t curr_max_width;
    do
      {
        curr_max_width = required_mon_width;
        required_mon_width = 0;
!       for (int i = 0; i < 12; i++)
          {
            size_t width = curr_max_width;
  
--- 1036,1045 ----
    size_t curr_max_width;
    do
      {
+       int i;
        curr_max_width = required_mon_width;
        required_mon_width = 0;
!       for (i = 0; i < 12; i++)
          {
            size_t width = curr_max_width;
  
*** src/sort.c.dist	Thu Feb  3 02:24:35 2011
--- src/sort.c	Thu Mar 17 20:23:49 2011
***************
*** 67,73 ****
    proper_name ("Mike Haertel"), \
    proper_name ("Paul Eggert")
  
! #if HAVE_LANGINFO_CODESET
  # include <langinfo.h>
  #endif
  
--- 67,73 ----
    proper_name ("Mike Haertel"), \
    proper_name ("Paul Eggert")
  
! #if HAVE_NL_LANGINFO
  # include <langinfo.h>
  #endif
  
*** src/stat.c.dist	Mon Jan 31 04:40:38 2011
--- src/stat.c	Thu Mar 17 20:53:00 2011
***************
*** 586,592 ****
                    if (1 < w)
                      {
                        char *dst = pformat;
!                       for (char const *src = dst; src < p; src++)
                          {
                            if (*src == '-')
                              frac_left_adjust = true;
--- 586,593 ----
                    if (1 < w)
                      {
                        char *dst = pformat;
! 		      char const *src;
!                       for (src = dst; src < p; src++)
                          {
                            if (*src == '-')
                              frac_left_adjust = true;
***************
*** 603,609 ****
      }
  
    int divisor = 1;
!   for (int i = precision; i < 9; i++)
      divisor *= 10;
    int frac_sec = arg.tv_nsec / divisor;
    int int_len;
--- 604,611 ----
      }
  
    int divisor = 1;
!   int i;
!   for (i = precision; i < 9; i++)
      divisor *= 10;
    int frac_sec = arg.tv_nsec / divisor;
    int int_len;




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8295; Package coreutils. (Sun, 20 Mar 2011 02:00:03 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Andreas Stolcke <stolcke <at> speech.sri.com>
Cc: 8295 <at> debbugs.gnu.org
Subject: Re: bug#8295: coreutils 8.10 portability fixes
Date: Sat, 19 Mar 2011 18:59:16 -0700
On 03/19/2011 12:04 PM, Andreas Stolcke wrote:
> - Several places where iterator variables are declared inside for(), failing compiles
>    on systems that support c99.

I assume you meant "systems that don't support c99".

The README file has a section "Pre-C99 build failure"
about that.  Which compiler were you using, and why
didn't "configure" successfully put it into c99 mode?




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8295; Package coreutils. (Sun, 20 Mar 2011 03:00:04 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Andreas Stolcke <stolcke <at> ICSI.Berkeley.EDU>
Cc: 8295 <at> debbugs.gnu.org
Subject: Re: bug#8295: coreutils 8.10 portability fixes
Date: Sat, 19 Mar 2011 19:59:28 -0700
On 03/19/2011 07:44 PM, Andreas Stolcke wrote:
> Good question, i don't know why configure didn't add -std=c99 to the CFLAGS.

Could you please take a look at config.log, or send a (compressed)
copy to the mailing list?  That should say why; look for the
string "option to accept ISO C99".  To be honest,
though, if this is merely a torture test for coreutils (to
see whether coreutils runs on a museum piece), it's probably low
priority.




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8295; Package coreutils. (Sun, 20 Mar 2011 03:08:02 GMT) Full text and rfc822 format available.

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

From: Andreas Stolcke <stolcke <at> ICSI.Berkeley.EDU>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 8295 <at> debbugs.gnu.org
Subject: Re: bug#8295: coreutils 8.10 portability fixes
Date: Sat, 19 Mar 2011 19:44:16 -0700
In message <4D855F74.3070604 <at> cs.ucla.edu>you wrote:
> On 03/19/2011 12:04 PM, Andreas Stolcke wrote:
> > - Several places where iterator variables are declared inside for(), failing compiles
> >    on systems that support c99.
> 
> I assume you meant "systems that don't support c99".

right.

> 
> The README file has a section "Pre-C99 build failure"
> about that.  Which compiler were you using, and why
> didn't "configure" successfully put it into c99 mode?

gcc-3.4.6 on mips-sgi-irix5.3, the last version i was able build on this old box.
Good question, i don't know why configure didn't add -std=c99 to the CFLAGS.
That would be the easier fix. 

--Andreas




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8295; Package coreutils. (Sun, 20 Mar 2011 04:47:02 GMT) Full text and rfc822 format available.

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

From: Andreas Stolcke <stolcke <at> icsi.berkeley.edu>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 8295 <at> debbugs.gnu.org
Subject: Re: bug#8295: coreutils 8.10 portability fixes
Date: Sat, 19 Mar 2011 20:09:34 -0700
Paul Eggert wrote:
> On 03/19/2011 07:44 PM, Andreas Stolcke wrote:
>   
>> Good question, i don't know why configure didn't add -std=c99 to the CFLAGS.
>>     
>
> Could you please take a look at config.log, or send a (compressed)
> copy to the mailing list?  That should say why; look for the
> string "option to accept ISO C99".  To be honest,
> though, if this is merely a torture test for coreutils (to
> see whether coreutils runs on a museum piece), it's probably low
> priority.
>   
We have this machine to run some legacy code.  We need coreutils because 
the system-supplied Unix tools have hardcoded limits, missing options, etc.

Andreas





Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8295; Package coreutils. (Sun, 17 Apr 2011 06:45:03 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: Andreas Stolcke <stolcke <at> ICSI.Berkeley.EDU>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 8295 <at> debbugs.gnu.org
Subject: Re: bug#8295: coreutils 8.10 portability fixes
Date: Sun, 17 Apr 2011 08:44:17 +0200
tags 8295 moreinfo
tags 8295 notabug
thanks

Andreas Stolcke wrote:
> In message <4D855F74.3070604 <at> cs.ucla.edu>you wrote:
>> On 03/19/2011 12:04 PM, Andreas Stolcke wrote:
>> > - Several places where iterator variables are declared inside
>> > for(), failing compiles
>> >    on systems that support c99.
>>
>> I assume you meant "systems that don't support c99".
>
> right.
>
>>
>> The README file has a section "Pre-C99 build failure"
>> about that.  Which compiler were you using, and why
>> didn't "configure" successfully put it into c99 mode?
>
> gcc-3.4.6 on mips-sgi-irix5.3, the last version i was able build on this old box.
> Good question, i don't know why configure didn't add -std=c99 to the CFLAGS.
> That would be the easier fix.

I've marked this as notabug for now, presuming the probmem is due
to your compiler.  Please let us know if you learn otherwise.




Added tag(s) notabug and moreinfo. Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Sun, 07 Aug 2011 16:57:01 GMT) Full text and rfc822 format available.

Reply sent to Bob Proulx <bob <at> proulx.com>:
You have taken responsibility. (Tue, 08 Apr 2014 17:29:54 GMT) Full text and rfc822 format available.

Notification sent to Andreas Stolcke <stolcke <at> speech.sri.com>:
bug acknowledged by developer. (Tue, 08 Apr 2014 17:29:55 GMT) Full text and rfc822 format available.

Message #27 received at 8295-done <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: 8295-done <at> debbugs.gnu.org, Andreas Stolcke <stolcke <at> ICSI.Berkeley.EDU>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, Jim Meyering <jim <at> meyering.net>
Subject: Re: bug#8295: coreutils 8.10 portability fixes
Date: Tue, 8 Apr 2014 11:29:28 -0600
Jim Meyering wrote:
> tags 8295 moreinfo
> tags 8295 notabug
> thanks
> 
> Andreas Stolcke wrote:
> > In message you wrote:
> >> On 03/19/2011 12:04 PM, Andreas Stolcke wrote:
> >> > - Several places where iterator variables are declared inside
> >> > for(), failing compiles
> >> >    on systems that support c99.
> >>
> >> I assume you meant "systems that don't support c99".
> >
> > right.
> >
> >> The README file has a section "Pre-C99 build failure"
> >> about that.  Which compiler were you using, and why
> >> didn't "configure" successfully put it into c99 mode?
> >
> > gcc-3.4.6 on mips-sgi-irix5.3, the last version i was able build on this old box.
> > Good question, i don't know why configure didn't add -std=c99 to the CFLAGS.
> > That would be the easier fix.
> 
> I've marked this as notabug for now, presuming the probmem is due
> to your compiler.  Please let us know if you learn otherwise.

Several years have passed and also several coreutils releases.
Nothing additional has been heard to this bug log concerning this in
that time.  Assuming that all is good and resolved.  Closing this bug
in the bug tracker.

Bob




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 07 May 2014 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 41 days ago.

Previous Next


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