bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strftime.c problem on dietlibc


From: Eelco Dolstra
Subject: strftime.c problem on dietlibc
Date: Wed, 18 Oct 2006 17:25:19 +0200
User-agent: Mail/News 1.5.0.7 (X11/20061016)

Hi,

When compiling coreutils-5.3 with dietlibc I got the following compiler error:

In file included from fprintftime.c:7:
strftime.c: In function 'strftime_case_':
strftime.c:645: error: invalid use of undefined type 'struct __stdio_file'
strftime.c:737: error: invalid use of undefined type 'struct __stdio_file'
etc.

The problem is in the following line in the add(n, f) macro in strftime.c:

  p += FPRINTFTIME ? 0 : _n;

where p is a FILE *.  If the storage size of FILE is not known (which is the
case on dietlibc), then the compiler cannot increase the pointer p, not even by 
0.

Patch (against latest CVS) is attached.

-- 
Eelco Dolstra | http://www.cs.uu.nl/~eelco
? strftime-uclibc.patch
Index: lib/strftime.c
===================================================================
RCS file: /sources/gnulib/gnulib/lib/strftime.c,v
retrieving revision 1.91
diff -c -r1.91 strftime.c
*** lib/strftime.c      8 Oct 2006 07:24:56 -0000       1.91
--- lib/strftime.c      18 Oct 2006 15:20:03 -0000
***************
*** 181,186 ****
--- 181,192 ----
  # define memset_zero(P, Len) (memset (P, '0', Len), (P) += (Len))
  #endif
  
+ #if FPRINTFTIME
+ #define advance(p, _n) ;
+ #else
+ #define advance(p, _n) p += _n;
+ #endif 
+ 
  #define add(n, f)                                                           \
    do                                                                        \
      {                                                                       \
***************
*** 199,205 ****
                memset_space (p, _delta);                                     \
            }                                                                 \
          f;                                                                  \
!         p += FPRINTFTIME ? 0 : _n;                                          \
        }                                                                     \
        i += _incr;                                                           \
      } while (0)
--- 205,211 ----
                memset_space (p, _delta);                                     \
            }                                                                 \
          f;                                                                  \
!         advance(p, _n);                                                     \
        }                                                                     \
        i += _incr;                                                           \
      } while (0)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]