groff
[Top][All Lists]
Advanced

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

Re: groff 1.23.0.rc4 on Solaris 10


From: G. Branden Robinson
Subject: Re: groff 1.23.0.rc4 on Solaris 10
Date: Sat, 15 Apr 2023 18:42:02 -0500

At 2023-04-15T23:43:18+0200, Bruno Haible wrote:
> On Solaris 10, I tried two compilers, like last time
> (see https://lists.gnu.org/archive/html/groff/2023-03/msg00005.html):
> 
> * The Sun C, C++ compilers.
> 
>   The build failure regarding <stdbool.h> is gone.
> 
>   Now there is a build failure:
> 
>   CC       src/libs/libgroff/libgroff_a-getopt.o
> "../src/libs/libgroff/getopt.c", line 251: syntax error before or at: (
> "../src/libs/libgroff/getopt.c", line 252: syntax error before or at: (
> "../src/libs/libgroff/getopt.c", line 253: syntax error before or at: const
> "../src/libs/libgroff/getopt.c", line 253: syntax error before or at: int
> "../src/libs/libgroff/getopt.c", line 254: syntax error before or at: struct
> "../src/libs/libgroff/getopt.c", line 254: syntax error before or at: )
> "../src/libs/libgroff/getopt.c", line 273: zero or negative subscript
> "../src/libs/libgroff/getopt.c", line 273: syntax error before or at: ==
> "../src/libs/libgroff/getopt.c", line 278: warning: old-style declaration or 
> incorrect type for: __posixly_correct
> "../src/libs/libgroff/getopt.c", line 279: warning: old-style declaration or 
> incorrect type for: d
> ...
> 
>   The cause is apparently the use of __attribute__((__unused__))
>   in src/libs/libgroff/getopt.c line 251.
> 
>   This syntax is not portable; it works only in GCC, clang, and AIX
>   xlc.
> 
>   Instead, you can use the Gnulib module 'attribute', #include
>   "attribute.h", and use MAYBE_UNUSED instead of
>   __attribute__((__unused__)). This is portable.

Okay.  I will scan the groff source tree for further use of attributes.

> * The gcc, g++ compilers.
> 
>   Now 152 instead of 150 test failures.

Gadzooks.  But I saw that movie myself on the FSF France compiler farm.

Does the advice in the PROBLEMS file clear these up for you?

--snip--
For Solaris 10, it is necessary to modify the shell-based test scripts
in place to use a conforming shell.  Here is an example.

  $ gsed -i -e '1s@#!/bin/sh@#!/usr/xpg4/bin/sh@' \
      `find . -name '*.sh' | grep /tests/`
  $ PATH=/usr/xpg4/bin:$PATH gmake check

Some test failures remain expected on Solaris 10.

1.  FAIL: tmac/tests/pdfpic_does-not-choke-on-bad-pdfinfo-output.sh

    /usr/bin/sed is non-conforming with the POSIX Issue 4 standard.

    Install GNU sed in the $PATH and edit tmac/pdfpic.tmac and change
    the "sed" on line 172 to "gsed".  Re-run "gmake check" as above.

    The sed in /usr/xpg4/bin also works, but pdfpic.tmac uses groff's
    `sy` request, which wraps the standard C library `system()`
    function, which sanitizes $PATH to avoid privilege escalation, thus
    making it likely that the non-conforming sed in /usr/bin will be
    found first.

2.  FAIL: contrib/hdtbl/examples/test-hdtbl.sh

    /usr/bin/tr is non-conforming with the POSIX Issue 4 standard.  It
    furthermore issues anonymous diagnostics, saying only "Bad string".

    Install tr from GNU coreutils in the $PATH.  Edit line 57 of each of
    contrib/hdtbl/examples/fonts_x.in and
    contrib/hdtbl/examples/fonts_n.in.  Change "tr" to "gtr".  Re-run
    "gmake check" as above.  (Some files will be rebuilt.)

    The tr commands in /usr/xpg4/bin and /usr/xpg6/bin also work, but
    the documents constructed from the above inputs use groff's `pso`
    request, which wraps the standard C library `popen()` function,
    which sanitizes $PATH to avoid privilege escalation, thus making it
    likely that the non-conforming tr in /usr/bin will be found first.

3.  FAIL: src/roff/groff/tests/initialization_is_quiet.sh
    FAIL: src/roff/groff/tests/msoquiet_works.sh
    FAIL: src/roff/groff/tests/soquiet_works.sh

    (The first of these might be SKIPped instead.)

    /usr/xpg4/bin/sh is non-conforming with the POSIX Issue 4 standard,
    despite its name.  Its "unset" builtin is buggy.

    These tests use the "unset" shell builtin command to prevent
    environment variables from confounding test results.

    POSIX says "[u]nsetting a variable ... that was not previously set
    is not considered an error and will not cause the shell to abort."

    Nevertheless this builtin returns an error exit status in this
    circumstance.

    $ /usr/xpg4/bin/sh -c 'unset _NON_EXISTENT_XYZ; echo $?'
    1

    You may disregard these failures, edit the test scripts to append
    "|| true" to the "unset" commands, or change the scripts to use GNU
    Bash or some other POSIX-conforming shell as illustrated above.
--end snip--

Thanks a lot for all this feedback.  Time to roll up my sleeves...

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

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