bug-gnulib
[Top][All Lists]
Advanced

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

<iconv.h> creates incorrect iconv() prototype


From: Andy Wingo
Subject: <iconv.h> creates incorrect iconv() prototype
Date: Sat, 09 Mar 2013 17:07:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Hi,

When cross-compiling Guile to mingw32, I get the following warning:

../../libguile/print.c: In function 'display_string_using_iconv':
../../libguile/print.c:914:7: warning: passing argument 2 of 'rpl_iconv' from 
incompatible pointer type [enabled by default]
In file included from ../../libguile/print.c:27:0:
../lib/iconv.h:387:1: note: expected 'const char **' but argument is of type 
'char **'

The code in question:

      char *input, *output;
      size_t input_left, output_left;
      /* ... */
      done = iconv (pt->output_cd, &input, &input_left,
                    &output, &output_left);

The specification of iconv:

  http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html

clearly states that the prototype should be char**, not const char**.
Shouldn't gnulib be providing a prototype with the specified interface?

Thanks,

Andy
-- 
http://wingolog.org/



reply via email to

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