#90 scsh cannot be build with gcc 4.0

closed-fixed
build (18)
5
2005-10-27
2005-05-03
Christoph Bauer
No

here is the error message:

c/unix/io.c: In function 'ps_write_integer':
c/unix/io.c:154: error: invalid storage class for
function 'write_integer'
c/unix/io.c: At top level:
c/unix/io.c:171: error: conflicting types for 'write_integer'
c/unix/io.c:160: error: previous implicit declaration
of 'write_integer' was here

OS: IRIX64

Discussion

  • Logged In: YES
    user_id=41822

    Bug as been reproduced under Debian GNU/Linux i386 and
    sparc. Here's a patch. It is also available as a download in
    a file from http://bugs.debian.org/324576

    diff -rN -u old-scsh-0.6-0.6.6/c/unix/io.c
    new-scsh-0.6-0.6.6/c/unix/io.c
    --- old-scsh-0.6-0.6.6/c/unix/io.c 2005-08-23
    14:38:58.000000000 +0200
    +++ new-scsh-0.6-0.6.6/c/unix/io.c 2005-08-23
    14:14:49.000000000 +0200
    @@ -146,13 +146,27 @@
    return 0; }
    }

    +static long
    +write_integer(unsigned long n, FILE *port)
    +{
    + char ch;
    + long status;
    +
    + if (n == 0)
    + status = 0;
    + else {
    + status = write_integer(n / 10, port);
    + if (status == 0) {
    + ch = (n % 10) + '0';
    + WRITE_CHAR(ch, port,status); } }
    + return status;
    +}
    +
    long
    ps_write_integer(long n, FILE *port)
    {
    int status;

    - static long write_integer(unsigned long n, FILE *port);
    -
    if (n == 0) {
    WRITE_CHAR('0', port, status);
    return status; }
    @@ -166,22 +180,6 @@
    return status; }
    }

    -static long
    -write_integer(unsigned long n, FILE *port)
    -{
    - char ch;
    - long status;
    -
    - if (n == 0)
    - status = 0;
    - else {
    - status = write_integer(n / 10, port);
    - if (status == 0) {
    - ch = (n % 10) + '0';
    - WRITE_CHAR(ch, port,status); } }
    - return status;
    -}
    -
    long
    ps_write_string(char *string, FILE *port)
    {

     
    • status: open --> closed
     
    • assigned_to: nobody --> mainzelm
    • status: closed --> closed-fixed
     
  • Logged In: YES
    user_id=17553

    Fixed as suggested by schoinobates.

    --
    Martin