Subject: Re: bug#19184: coreutils-8.23 Compile Error on Solaris 8 - Sun Studio 11

From: Pádraig Brady <[email-masked]>
Date: Wed, 26 Nov 2014 20:37:16 +0000

On 26/11/14 19:21, Paul Eggert wrote:
> On 11/26/2014 06:19 AM, Ted Carr wrote:
>> I get some errors when running 'make check'.  You have any time to help with those or should I just send in another email?
> Can't hurt to email them to [email-masked].  Can't promise anything: Solaris 8 isn't supported any more by Oracle, so it's mostly off our radar.  Anyway, I'm marking this bug as done.

Ted emailed me privately by mistake.

There 2 issues. The first was a weird one with the shell's printf
which the attached patch will hopefully avoid.

The other issue is incorrect prompts output by rm due to its use of %zu
Ted could you give the output of:

  grep gl_cv_func_printf_sizes_c99 config.log

Now coreutils doesn't make use of the fprintf-posix module
to act on the above test.
Jim attempted it for a day in 2007 but reverted due to "too many test failures".
We could easily avoid the use of %zu I suppose in coreutils,
as there are only a few uses really.

thanks,
Pádraig.
From a78d85386bf4a55d7ccbd7c03c0075615b3f61d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email-masked]>
Date: Wed, 26 Nov 2014 20:15:15 +0000
Subject: [PATCH] tests: fix portability issue in dd/ascii test

Solaris 8 was seen to issue this error:
"printf: `&': illegal format character"

* test/dd/ascii.sh: Use the coreutils printf in this test
rather than the system one, to avoid portability issues.
---
 tests/dd/ascii.sh | 71 ++++++++++++++++++++++++++++---------------------------
 1 file changed, 36 insertions(+), 35 deletions(-)

diff --git a/tests/dd/ascii.sh b/tests/dd/ascii.sh
index 7dc39cc..98a57a1 100755
--- a/tests/dd/ascii.sh
+++ b/tests/dd/ascii.sh
@@ -21,45 +21,46 @@ print_ver_ dd
 
 {
   # Two lines, EBCDIC " A A" and " A  ", followed by all the bytes in order.
-  printf '\100\301\100\301\100\301\100\100' &&
-  printf $(printf '\\%03o' $(seq 0 255));
+  env printf '\100\301\100\301\100\301\100\100' &&
+  env printf $(env printf '\\%03o' $(seq 0 255));
 } >in || framework_failure_
 
 {
   # The converted lines, with trailing spaces removed.
-  printf ' A A\n A\n' &&
-  printf '\000\001\002\003\n\234\011\206\177\n' &&
-  printf '\227\215\216\013\n\014\015\016\017\n' &&
-  printf '\020\021\022\023\n\235\205\010\207\n' &&
-  printf '\030\031\222\217\n\034\035\036\037\n' &&
-  printf '\200\201\202\203\n\204\012\027\033\n' &&
-  printf '\210\211\212\213\n\214\005\006\007\n' &&
-  printf '\220\221\026\223\n\224\225\226\004\n' &&
-  printf '\230\231\232\233\n\024\025\236\032\n' &&
-  printf '\040\240\241\242\n\243\244\245\246\n' &&
-  printf '\247\250\325\056\n\074\050\053\174\n' &&
-  printf '\046\251\252\253\n\254\255\256\257\n' &&
-  printf '\260\261\041\044\n\052\051\073\176\n' &&
-  printf '\055\057\262\263\n\264\265\266\267\n' &&
-  printf '\270\271\313\054\n\045\137\076\077\n' &&
-  printf '\272\273\274\275\n\276\277\300\301\n' &&
-  printf '\302\140\072\043\n\100\047\075\042\n' &&
-  printf '\303\141\142\143\n\144\145\146\147\n' &&
-  printf '\150\151\304\305\n\306\307\310\311\n' &&
-  printf '\312\152\153\154\n\155\156\157\160\n' &&
-  printf '\161\162\136\314\n\315\316\317\320\n' &&
-  printf '\321\345\163\164\n\165\166\167\170\n' &&
-  printf '\171\172\322\323\n\324\133\326\327\n' &&
-  printf '\330\331\332\333\n\334\335\336\337\n' &&
-  printf '\340\341\342\343\n\344\135\346\347\n' &&
-  printf '\173\101\102\103\n\104\105\106\107\n' &&
-  printf '\110\111\350\351\n\352\353\354\355\n' &&
-  printf '\175\112\113\114\n\115\116\117\120\n' &&
-  printf '\121\122\356\357\n\360\361\362\363\n' &&
-  printf '\134\237\123\124\n\125\126\127\130\n' &&
-  printf '\131\132\364\365\n\366\367\370\371\n' &&
-  printf '\060\061\062\063\n\064\065\066\067\n' &&
-  printf '\070\071\372\373\n\374\375\376\377\n';
+env printf \
+' A A\n A\n'\
+'\000\001\002\003\n\234\011\206\177\n'\
+'\227\215\216\013\n\014\015\016\017\n'\
+'\020\021\022\023\n\235\205\010\207\n'\
+'\030\031\222\217\n\034\035\036\037\n'\
+'\200\201\202\203\n\204\012\027\033\n'\
+'\210\211\212\213\n\214\005\006\007\n'\
+'\220\221\026\223\n\224\225\226\004\n'\
+'\230\231\232\233\n\024\025\236\032\n'\
+'\040\240\241\242\n\243\244\245\246\n'\
+'\247\250\325\056\n\074\050\053\174\n'\
+'\046\251\252\253\n\254\255\256\257\n'\
+'\260\261\041\044\n\052\051\073\176\n'\
+'\055\057\262\263\n\264\265\266\267\n'\
+'\270\271\313\054\n\045\137\076\077\n'\
+'\272\273\274\275\n\276\277\300\301\n'\
+'\302\140\072\043\n\100\047\075\042\n'\
+'\303\141\142\143\n\144\145\146\147\n'\
+'\150\151\304\305\n\306\307\310\311\n'\
+'\312\152\153\154\n\155\156\157\160\n'\
+'\161\162\136\314\n\315\316\317\320\n'\
+'\321\345\163\164\n\165\166\167\170\n'\
+'\171\172\322\323\n\324\133\326\327\n'\
+'\330\331\332\333\n\334\335\336\337\n'\
+'\340\341\342\343\n\344\135\346\347\n'\
+'\173\101\102\103\n\104\105\106\107\n'\
+'\110\111\350\351\n\352\353\354\355\n'\
+'\175\112\113\114\n\115\116\117\120\n'\
+'\121\122\356\357\n\360\361\362\363\n'\
+'\134\237\123\124\n\125\126\127\130\n'\
+'\131\132\364\365\n\366\367\370\371\n'\
+'\060\061\062\063\n\064\065\066\067\n'\
+'\070\071\372\373\n\374\375\376\377\n';
 } >exp || framework_failure_
 
 dd if=in of=out conv=ascii cbs=4 || fail=1
-- 
2.1.0