bug-gnulib
[Top][All Lists]
Advanced

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

Re: unistr.h: declare u{8,16}_uctomb_aux for u{8,16}-chr


From: Bruno Haible
Subject: Re: unistr.h: declare u{8,16}_uctomb_aux for u{8,16}-chr
Date: Sun, 28 Oct 2007 21:48:05 +0100
User-agent: KMail/1.5.4

Hello Ralf,

Ralf Wildenhues wrote:
> The Intel compiler 9.0 gives these warnings on GNU/Linux:
> 
> | ../../gllib/unistr/u16-chr.c(39): warning #266: function declared implicitly
> |       switch (u16_uctomb_aux (c, uc, 2))
> | 
> | ../../gllib/unistr/u8-chr.c(39): warning #266: function declared implicitly
> |       switch (u8_uctomb_aux (c, uc, 6))
> 
> Similar for u{8,16}-strchr.c.

Thanks for noticing and reporting this!

> The patch below gets rid of the warning.  OK to apply?

It's not all that's needed: The u*_uctomb_aux functions need not only to be
declared, but also to be defined. I've applied this:


2007-10-28  Ralf Wildenhues  <address@hidden>
            Bruno Haible  <address@hidden>

        * lib/unistr.h (u8_uctomb_aux): Declare also if !HAVE_INLINE.
        (u16_uctomb_aux): Likewise.
        * lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Define also if
        !HAVE_INLINE.
        * lib/unistr/u16-uctomb-aux.c (u16_uctomb_aux): Likewise

*** lib/unistr.h.orig   2007-10-28 21:43:23.000000000 +0100
--- lib/unistr.h        2007-10-28 21:17:14.000000000 +0100
***************
*** 297,308 ****
     must be specified.  */
  
  #ifdef GNULIB_UNISTR_U8_UCTOMB
  # if !HAVE_INLINE
  extern int
         u8_uctomb (uint8_t *s, ucs4_t uc, int n);
  # else
- extern int
-        u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n);
  static inline int
  u8_uctomb (uint8_t *s, ucs4_t uc, int n)
  {
--- 297,309 ----
     must be specified.  */
  
  #ifdef GNULIB_UNISTR_U8_UCTOMB
+ /* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr.  */
+ extern int
+        u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n);
  # if !HAVE_INLINE
  extern int
         u8_uctomb (uint8_t *s, ucs4_t uc, int n);
  # else
  static inline int
  u8_uctomb (uint8_t *s, ucs4_t uc, int n)
  {
***************
*** 318,329 ****
  #endif
  
  #ifdef GNULIB_UNISTR_U16_UCTOMB
  # if !HAVE_INLINE
  extern int
         u16_uctomb (uint16_t *s, ucs4_t uc, int n);
  # else
- extern int
-        u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n);
  static inline int
  u16_uctomb (uint16_t *s, ucs4_t uc, int n)
  {
--- 319,331 ----
  #endif
  
  #ifdef GNULIB_UNISTR_U16_UCTOMB
+ /* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr.  */
+ extern int
+        u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n);
  # if !HAVE_INLINE
  extern int
         u16_uctomb (uint16_t *s, ucs4_t uc, int n);
  # else
  static inline int
  u16_uctomb (uint16_t *s, ucs4_t uc, int n)
  {
*** lib/unistr/u16-uctomb-aux.c.orig    2007-10-28 21:43:23.000000000 +0100
--- lib/unistr/u16-uctomb-aux.c 2007-10-28 21:15:33.000000000 +0100
***************
*** 20,27 ****
  /* Specification.  */
  #include "unistr.h"
  
- #if HAVE_INLINE
- 
  int
  u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n)
  {
--- 20,25 ----
***************
*** 58,62 ****
      }
    return -2;
  }
- 
- #endif
--- 56,58 ----
*** lib/unistr/u8-uctomb-aux.c.orig     2007-10-28 21:43:23.000000000 +0100
--- lib/unistr/u8-uctomb-aux.c  2007-10-28 21:15:11.000000000 +0100
***************
*** 20,27 ****
  /* Specification.  */
  #include "unistr.h"
  
- #if HAVE_INLINE
- 
  int
  u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n)
  {
--- 20,25 ----
***************
*** 69,73 ****
      }
    return count;
  }
- 
- #endif
--- 67,69 ----





reply via email to

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