bug-coreutils
[Top][All Lists]
Advanced

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

coreutils-4.5.9: SGI IRIX 6.5 build failure, and a simple patch


From: Nelson H. F. Beebe
Subject: coreutils-4.5.9: SGI IRIX 6.5 build failure, and a simple patch
Date: Thu, 6 Mar 2003 08:26:46 -0700 (MST)

The coreutils-4.5.9 build with native c89 on SGI IRIX 6.5 failed
like this:

        c89 -DLIBDIR=\"/usr/local/lib\" -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.  
-I/usr/local/include  -g -c `test -f 'getcwd.c' || echo './'`getcwd.c
        cc-1140 c89: ERROR File = getcwd.c, Line = 59
          A value of type "int" cannot be used to initialize an entity of type 
"char *".

            char *cwd = getcwd (buf, size);
                        ^

        1 error detected in the compilation of "getcwd.c".

The reason is that the prototype for getcwd is not visible in the c89
environment.

I added a suitable prototype:

        diff lib/getcwd.c.~1~ lib/getcwd.c
        38a39,40
        > extern char *(getcwd)(char *, size_t);
        >

restarted the make, and all of the validation tests then passed.

My patch is a temporary hack.  configure already does some getcwd
tests:

        checking whether getcwd (NULL, 0) allocates memory for result... no
        checking for getcwd... yes
        checking whether getcwd properly handles paths longer than PATH_MAX... 
yes

It just needs to make one more check for declaration of that function,
and if it isn't found, supply one similar to mine above [the
parentheses around getcwd are needed because the code has

        #undef getcwd

just before that].

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- Center for Scientific Computing       FAX: +1 801 581 4148                  -
- University of Utah                    Internet e-mail: address@hidden  -
- Department of Mathematics, 110 LCB        address@hidden  address@hidden -
- 155 S 1400 E RM 233                       address@hidden                    -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -
-------------------------------------------------------------------------------




reply via email to

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