bug-bison
[Top][All Lists]
Advanced

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

Re: bison-1.875: build feedback


From: Paul Eggert
Subject: Re: bison-1.875: build feedback
Date: Fri, 3 Jan 2003 07:02:08 -0800 (PST)

> Date: Thu, 2 Jan 2003 07:28:09 -0700 (MST)
> From: "Nelson H. F. Beebe" <address@hidden>
> 
> Compilation of bison-1.875 with native c89 on SGI IRIX 6.5 produced a
> successful build, validation, and installation.  However, the compiler
> reported some crud and other irregularities in the code:

Thanks for your detailed bug report.


> ------------------------------------------------------------------------
> c89 -mips3 -O2 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../src -I../lib 
> -I/usr/local/include  -g -c `test -f 'bitset.c' || echo './'`bitset.c
> cc-1116 c89: WARNING File = bitset.c, Line = 87
>   Non-void function "bitset_init" (declared at line 68) should return a value.

It seems that your compiler does not know that abort () cannot return.
Or perhaps abort () can return on that platform, in some circumstances?
If so, is it possible that this would happen with Bison?
Otherwise I don't think it's worth worrying about.


> cc-1515 c89: WARNING File = bitset.c, Line = 149
>   A value of type "char *" cannot be assigned to an entity of type "bitset".

Does the following patch fix this class of warnings?

--- lib/obstack.h.~1.6.~        2002-12-13 03:24:16.000000000 -0800
+++ lib/obstack.h       2003-01-03 06:47:53.263321000 -0800
@@ -123,8 +123,12 @@ extern "C" {
 #endif
 
 #ifndef __INT_TO_PTR
+#if defined __STDC__ && __STDC__
+# define __INT_TO_PTR(P) ((void *) ((P) + (char *) 0))
+#else
 # define __INT_TO_PTR(P) ((P) + (char *) 0)
 #endif
+#endif
 
 /* We need the type of the resulting object.  If __PTRDIFF_TYPE__ is
    defined, as with GNU C, use that; that way we don't pollute the



> cc-1552 c89: WARNING File = bitset_stats.c, Line = 579
>   The variable "type" is set but never used.

I installed this patch.

--- lib/bitset_stats.c  30 Oct 2002 06:17:52 -0000      1.7
+++ lib/bitset_stats.c  3 Jan 2003 14:52:53 -0000       1.8
@@ -576,11 +576,9 @@ bitset_stats_list (bitset bset, bitset_b
   bitset_bindex tmp;
   bitset_bindex size;
   bitset_bindex i;
-  enum bitset_type type;
 
   count = BITSET_LIST_ (bset->s.bset, list, num, next);
 
-  type = BITSET_TYPE_ (bset->s.bset);
   BITSET_STATS_LISTS_INC (bset->s.bset);
 
   /* Log histogram of number of set bits.  */


> cc-1185 c89: WARNING File = location.h, Line = 43
>   An enumerated type is mixed with another type.

I installed this patch to work around this class of problems.

2003-01-03  Paul Eggert  <address@hidden>

        * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
        Use the pattern recommended by Autoconf 2.57, except also protect
        against double-definition.
        * src/system.h: Likewise.

--- lib/hash.c  28 Nov 2002 00:42:28 -0000      1.9
+++ lib/hash.c  3 Jan 2003 14:14:24 -0000       1.10
@@ -1,5 +1,8 @@
 /* hash - hashing table processing.
-   Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+   Foundation, Inc.
+
    Written by Jim Meyering, 1992.
 
    This program is free software; you can redistribute it and/or modify
@@ -27,11 +30,25 @@
 #if HAVE_STDLIB_H
 # include <stdlib.h>
 #endif
+
 #if HAVE_STDBOOL_H
 # include <stdbool.h>
 #else
-typedef enum {false = 0, true = 1} bool;
+# ifndef __bool_true_false_are_defined
+#  if ! HAVE__BOOL
+#   ifdef __cplusplus
+typedef bool _Bool;
+#   else
+typedef unsigned char _Bool;
+#   endif
+#  endif
+#  define bool _Bool
+#  define false 0
+#  define true 1
+#  define __bool_true_false_are_defined 1
+# endif
 #endif
+
 #include <stdio.h>
 
 #ifndef HAVE_DECL_FREE
--- src/system.h        13 Dec 2002 08:44:28 -0000      1.58
+++ src/system.h        3 Jan 2003 14:15:16 -0000       1.59
@@ -1,5 +1,6 @@
 /* System-dependent definitions for Bison.
-   Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -185,7 +186,19 @@ void *memrchr (const void *s, int c, siz
 #if HAVE_STDBOOL_H
 # include <stdbool.h>
 #else
-typedef enum {false = 0, true = 1} bool;
+# ifndef __bool_true_false_are_defined
+#  if ! HAVE__BOOL
+#   ifdef __cplusplus
+typedef bool _Bool;
+#   else
+typedef unsigned char _Bool;
+#   endif
+#  endif
+#  define bool _Bool
+#  define false 0
+#  define true 1
+#  define __bool_true_false_are_defined 1
+# endif
 #endif
 
 




reply via email to

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