Hi!

----

While trying to build a working ksh93 from ast-ksh.2013-10-10 on SuSE
12.3/AMD/64bit using the PathScale pathcc compiler I hit the following
warnings:
-- snip --
+ cc -D_BLD_DLL -fPIC -D_BLD_ast '-DSHOPT_CMDLIB_BLTIN=0'
'-DSH_CMDLIB_DIR="/usr/ast/bin"'
'-DSHOPT_CMDLIB_HDR="/home/test001/work/ast_ksh_20131010/build_pathcc/tmp_gnulinux_built
in_header.h"' -DSHOPT_SYSRC '-D_map_libc=1' -O2 -fstrict-aliasing
-Wstrict-aliasing -Wsequence-point -Wno-parentheses -Wno-unused
-Wno-trigraphs -Wuninitialized -Waddress -I. -I/h
ome/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast -Icomp
-I/home/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast/comp
-Iport -I/home/test001/work/ast_ksh_201
31010/build_pathcc/src/lib/libast/port -Iinclude
-I/home/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast/include
-Istd -I/home/test001/work/ast_ksh_20131010/build_pathcc
/src/lib/libast/std -D_PACKAGE_ast -c
/home/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast/string/wcstoutf32s.c
/home/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast/string/wcstoutf32s.c:48:34:
warning: comparison of unsigned expression < 0 is always false
[-Wtautological-compare]
                        if (mbconv(tmp, wchar[i], &q) < 0)
                            ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
/home/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast/string/wcstoutf32s.c:64:106:
warning: comparison between pointer and integer ('void *' and 'int')
                if (ast.mb_wc2uc == (void*)(-1) && (ast.mb_wc2uc =
(void*)iconv_open("UTF-8", codeset(CODESET_ctype))) == -1)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
~~
2 warnings generated.
+ cc -D_BLD_DLL -fPIC -D_BLD_ast '-DSHOPT_CMDLIB_BLTIN=0'
'-DSH_CMDLIB_DIR="/usr/ast/bin"'
'-DSHOPT_CMDLIB_HDR="/home/test001/work/ast_ksh_20131010/build_pathcc/tmp_gnulinux_built
in_header.h"' -DSHOPT_SYSRC '-D_map_libc=1' -O2 -fstrict-aliasing
-Wstrict-aliasing -Wsequence-point -Wno-parentheses -Wno-unused
-Wno-trigraphs -Wuninitialized -Waddress -I. -I/h
ome/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast -Icomp
-I/home/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast/comp
-Iport -I/home/test001/work/ast_ksh_201
31010/build_pathcc/src/lib/libast/port -Iinclude
-I/home/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast/include
-Istd -I/home/test001/work/ast_ksh_20131010/build_pathcc
/src/lib/libast/std -D_PACKAGE_ast -c
/home/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast/string/utf32stowcs.c
/home/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast/string/utf32stowcs.c:49:34:
warning: comparison of unsigned expression < 0 is always false
[-Wtautological-compare]
                        if (mbconv(tmp, utf32[i], &q) < 0)
                            ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
/home/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast/string/utf32stowcs.c:80:83:
warning: comparison of unsigned expression < 0 is always false
[-Wtautological-compare]
                        if (iconv((iconv_t)ast.mb_uc2wc, &inbuf,
&inbytesleft, &outbuf, &outbytesleft) < 0 || inbytesleft)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^ ~
/home/test001/work/ast_ksh_20131010/build_pathcc/src/lib/libast/string/utf32stowcs.c:118:83:
warning: comparison of unsigned expression < 0 is always false
[-Wtautological-compare]
                        if (iconv((iconv_t)ast.mb_uc2wc, &inbuf,
&inbytesleft, &outbuf, &outbytesleft) < 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^ ~
3 warnings generated.
-- snip --

Attached (as "astksh20131010_pathcc_wcsfixes001.diff.txt") is a patch
which fixes these problems...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
diff -r -u build_i386_64bit_debug/src/lib/libast/string/utf32stowcs.c 
build_pathcc/src/lib/libast/string/utf32stowcs.c
--- src/lib/libast/string/utf32stowcs.c 2013-09-18 05:37:25.000000000 +0200
+++ src/lib/libast/string/utf32stowcs.c 2013-10-24 12:57:18.394408630 +0200
@@ -46,7 +46,7 @@
                mbinit(&q);
                for (i = 0; i < n; i++)
                {
-                       if (mbconv(tmp, utf32[i], &q) < 0)
+                       if (mbconv(tmp, utf32[i], &q) == (size_t)-1)
                                break;
                        wchar[i] = utf32[i];
                }
@@ -77,7 +77,7 @@
                        inbuf = tmp_in;
                        outbuf = tmp_out;
                        outbytesleft = sizeof(tmp_out);
-                       if (iconv((iconv_t)ast.mb_uc2wc, &inbuf, &inbytesleft, 
&outbuf, &outbytesleft) < 0 || inbytesleft)
+                       if (iconv((iconv_t)ast.mb_uc2wc, &inbuf, &inbytesleft, 
&outbuf, &outbytesleft) == (size_t)(-1) || inbytesleft)
                                return -1;
                        if (!mbwide())
                        {
@@ -115,7 +115,7 @@
                        inbuf           = inbuf_start;
                        outbuf          = outbuf_start;
                        i               = 0;
-                       if (iconv((iconv_t)ast.mb_uc2wc, &inbuf, &inbytesleft, 
&outbuf, &outbytesleft) < 0)
+                       if (iconv((iconv_t)ast.mb_uc2wc, &inbuf, &inbytesleft, 
&outbuf, &outbytesleft) == (size_t)(-1))
                                return -1;
                        inbuf = outbuf;
                        if (mbwide())
diff -r -u build_i386_64bit_debug/src/lib/libast/string/wcstoutf32s.c 
build_pathcc/src/lib/libast/string/wcstoutf32s.c
--- src/lib/libast/string/wcstoutf32s.c 2013-09-17 18:10:56.000000000 +0200
+++ src/lib/libast/string/wcstoutf32s.c 2013-10-24 12:50:35.622567718 +0200
@@ -45,7 +45,7 @@
                mbinit(&q);
                for (i = 0; i < n; i++)
                {
-                       if (mbconv(tmp, wchar[i], &q) < 0)
+                       if (mbconv(tmp, wchar[i], &q) == (size_t)-1)
                                break;
                        utf32[i] = wchar[i];
                }
@@ -61,7 +61,7 @@
                size_t          outbytesleft;
                int             oerrno;
 
-               if (ast.mb_wc2uc == (void*)(-1) && (ast.mb_wc2uc = 
(void*)iconv_open("UTF-8", codeset(CODESET_ctype))) == -1)
+               if (ast.mb_wc2uc == (void*)(-1) && (ast.mb_wc2uc = 
(void*)iconv_open("UTF-8", codeset(CODESET_ctype))) == (void*)(-1))
                        ast.mb_wc2uc = 0;
                if (ast.mb_wc2uc == 0)
                        return -1;
@@ -77,7 +77,7 @@
 
                        mbinit(&q);
                        for (inbuf = inbuf_start, i = 0; i < n; i++, inbuf += 
len)
-                               if ((len = mbconv(inbuf, wchar[i], &q)) < 0)
+                               if ((len = mbconv(inbuf, wchar[i], &q)) == 
(size_t)-1)
                                {
                                        inbuf[i] = 0;
                                        break;
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to