bugfindutils - Bugs: bug #4830, configure problem with stdbool.h

 
 

bug #4830: configure problem with stdbool.h

Submitter:  Invalid User ID <#22109>
Submitted:  Mon 18 Aug 2003 09:10:49 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Closed
Release:  None Fixed Release:  4.2.7
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 22 Nov 2004 12:00:02 AM UTC, comment #2: 

I have a subsequent report of findutils compiling OK on UNICOS on a Cray Y-MP.  Hence I will assume that this problem has now been solved.

James Youngman <jay>
Group administrator
Sat 30 Oct 2004 09:23:22 AM UTC, comment #1: 

Looking in the "configure" file that we have in the CVS code,  it will generate a copy of stdbool.h if it thinks one is required.  I think this is also present in findutils-4.2.2 which you can download from ftp://alpha.gnu.org/gnu/findutils.   Could yo give that a try and let me know what you find out?

James Youngman <jay>
Group administrator
Mon 18 Aug 2003 09:10:49 PM UTC, original submission:  

i'm in the process of checking out a snapshot provided to me by james youngman of a snapshot of the CVS tree of findutils, from 8 august.
i've had findutils-4.1 running on all the cray architectures for several years.
i'm having trouble getting the compile to complete for this snapshot.  the problem seems to be that there is no stdbool.h.
...
cc -DHAVE_CONFIG_H -I. -I. -I..     -g -c `test -f 'human.c' || echo './'`human.c
CC-5 cc: ERROR File = human.h, Line = 30
  The source file "stdbool.h" is unavailable.

  # include <stdbool.h>
                       ^

make[5]: * [human.o] Error 1
make[5]: Leaving directory `/ptmp/wendyp/finddir/findutils-4.2.0/gnulib/lib'

well, that's true, there is no stdbool.h on a non-X1 cray machine.

so, i checked out my redhat linux box, and it also does not have a stdbool.h file) but it completes compiling with no problem.

i don't understand this at all.  but i was able to overcome the confusion and find something that works.

"typedef char bool" works for gnulib/lib/human.h.
it looks like someone ran into a similar problem in find/defs.h, but the #ifdef structure there makes no sense to me.

for the "bool" type to work on a UNICOS machine, the following patches are needed:
$ diff -c gnulib/lib/human.h.orig gnulib/lib/human.h
* gnulib/lib/human.h.orig     Mon Aug 18 15:41:32 2003
--- gnulib/lib/human.h  Mon Aug 18 16:04:38 2003
*************
* 27,34 **
  # endif
 
  # include <limits.h>
  # include <stdbool.h>
!
  # if HAVE_INTTYPES_H
  #  include <inttypes.h>
  # else
--- 27,37 ----
  # endif
 
  # include <limits.h>
+ # ifndef _UNICOS
  # include <stdbool.h>
! # else
! typedef char bool;
! # endif /* _UNICOS */
  # if HAVE_INTTYPES_H
  #  include <inttypes.h>
  # else


$ diff -c find/defs.h.orig find/defs.h
* find/defs.h.orig    Mon Aug 18 15:53:18 2003
--- find/defs.h Mon Aug 18 16:09:00 2003
*************
* 128,134 **
  #define MODE_ALL      (S_ISUID | S_ISGID | S_ISVTX | MODE_RWX)
 
  #if 1
! #include <stdbool.h>
  typedef bool boolean;
  #else
  /* Not char because of type promotion; NeXT gcc can't handle it.  */
--- 128,140 ----
  #define MODE_ALL      (S_ISUID | S_ISGID | S_ISVTX | MODE_RWX)
 
  #if 1
! # ifndef _UNICOS
! # include <stdbool.h>
! # else
! typedef char bool;
! #define       true    1
! #define       false   0
! # endif /* _UNICOS */
  typedef bool boolean;
  #else
  /* Not char because of type promotion; NeXT gcc can't handle it.  */

Invalid User ID <#22109>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-11-22 jay StatusNone Fixed
    Open/ClosedOpen Closed
    Fixed ReleaseNone 4.2.7
2004-10-30 jay Assigned toNone jay

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code