bug-bison
[Top][All Lists]
Advanced

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

bison-1.875: build feedback


From: Nelson H. F. Beebe
Subject: bison-1.875: build feedback
Date: Thu, 2 Jan 2003 07:28:09 -0700 (MST)

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:

------------------------------------------------------------------------
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.

  }
  ^

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

    bset = obstack_alloc (bobstack, bytes);
         ^
------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../src -I../lib 
-I/usr/local/include  -g -c `test -f 'ebitset.c' || echo './'`ebitset.c
cc-1116 c89: WARNING File = ebitset.c, Line = 322
  Non-void function "ebitset_elt_find" (declared at line 260) should return a
          value.

  }
  ^
------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../src -I../lib 
-I/usr/local/include  -g -c `test -f 'bitset_stats.c' || echo
'./'`bitset_stats.c
cc-1552 c89: WARNING File = bitset_stats.c, Line = 579
  The variable "type" is set but never used.

    enum bitset_type type;
                     ^
------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../src -I../lib 
-I/usr/local/include  -g -c `test -f 'lbitset.c' || echo './'`lbitset.c
cc-1116 c89: WARNING File = lbitset.c, Line = 381
  Non-void function "lbitset_elt_find" (declared at line 317) should return a
          value.

  }
  ^
------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -DPKGDATADIR=\"/usr/local/share/bison\"
-DLOCALEDIR=\"/usr/local/share/locale\" -I. -I. -I.. -I.. -I../lib 
-I/usr/local/include   -g -c `test -f 'LR0.c' || echo './'`LR0.c
cc-1185 c89: WARNING File = location.h, Line = 43
  An enumerated type is mixed with another type.

    return (a.column == b.column
           ^

[repeated for closure.c, complain.c, conflicts.c, ...]

------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -DPKGDATADIR=\"/usr/local/share/bison\"
-DLOCALEDIR=\"/usr/local/share/locale\" -I. -I. -I.. -I.. -I../lib 
-I/usr/local/include   -g -c `test -f 'gram.c' || echo './'`gram.c
...
cc-1185 c89: WARNING File = gram.c, Line = 60
  An enumerated type is mixed with another type.

    return r->number < nrules;
           ^

cc-1185 c89: WARNING File = gram.c, Line = 71
  An enumerated type is mixed with another type.

    return r->number >= nrules;
           ^

cc-1185 c89: WARNING File = gram.c, Line = 83
  An enumerated type is mixed with another type.

    return !r->useful && r->number < nrules;
           ^
------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -DPKGDATADIR=\"/usr/local/share/bison\"
-DLOCALEDIR=\"/usr/local/share/locale\" -I. -I. -I.. -I.. -I../lib 
-I/usr/local/include   -g -c `test -f 'muscle_tab.c' || echo './'`muscle_tab.c
cc-1185 c89: WARNING File = muscle_tab.c, Line = 50
  An enumerated type is mixed with another type.

    return strcmp (m1->key, m2->key) == 0;
           ^
------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -DPKGDATADIR=\"/usr/local/share/bison\"
-DLOCALEDIR=\"/usr/local/share/locale\" -I. -I. -I.. -I.. -I../lib 
-I/usr/local/include   -g -c `test -f 'nullable.c' || echo './'`nullable.c
cc-1185 c89: WARNING File = nullable.c, Line = 110
  An enumerated type is mixed with another type.

                nullable[rules_ruleno->lhs->number - ntokens] = 1;
                                                              ^
cc-1185 c89: WARNING File = nullable.c, Line = 123
  An enumerated type is mixed with another type.

              nullable[r->lhs->number - ntokens] = 1;
                                                 ^
------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -DPKGDATADIR=\"/usr/local/share/bison\"
-DLOCALEDIR=\"/usr/local/share/locale\" -I. -I. -I.. -I.. -I../lib 
-I/usr/local/include   -g -c `test -f 'reduce.c' || echo './'`reduce.c
cc-1185 c89: WARNING File = location.h, Line = 43
cc-1185 c89: WARNING File = reduce.c, Line = 240
  An enumerated type is mixed with another type.

        rules[r].useful = bitset_test (P, r);
                        ^
------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -DPKGDATADIR=\"/usr/local/share/bison\"
-DLOCALEDIR=\"/usr/local/share/locale\" -I. -I. -I.. -I.. -I../lib 
-I/usr/local/include   -g -c `test -f 'scan-gram.c' || echo './'`scan-gram.c
...
cc-1185 c89: WARNING File = scan-gram.l, Line = 512
  An enumerated type is mixed with another type.

      bool valid = yytext[0] == '{' || token_type == PERCENT_UNION;
                   ^

cc-1185 c89: WARNING File = scan-gram.l, Line = 546
  An enumerated type is mixed with another type.

      bool outer_brace = --braces_level < 0;
                         ^
------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -DPKGDATADIR=\"/usr/local/share/bison\"
-DLOCALEDIR=\"/usr/local/share/locale\" -I. -I. -I.. -I.. -I../lib 
-I/usr/local/include   -g -c `test -f 'state.c' || echo './'`state.c
cc-1116 c89: WARNING File = state.c, Line = 65
  Non-void function "transitions_to" (declared at line 58) should return a
value.

  }
  ^
------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -DPKGDATADIR=\"/usr/local/share/bison\"
-DLOCALEDIR=\"/usr/local/share/locale\" -I. -I. -I.. -I.. -I../lib 
-I/usr/local/include   -g -c `test -f 'symtab.c' || echo './'`symtab.c
cc-1185 c89: WARNING File = location.h, Line = 43
cc-1185 c89: WARNING File = symtab.c, Line = 397
  An enumerated type is mixed with another type.

    return UNIQSTR_EQ (m1->tag, m2->tag);
           ^
------------------------------------------------------------------------
c89 -mips3 -O2 -DHAVE_CONFIG_H -DPKGDATADIR=\"/usr/local/share/bison\"
-DLOCALEDIR=\"/usr/local/share/locale\" -I. -I. -I.. -I.. -I../lib 
-I/usr/local/include   -g -c `test -f 'uniqstr.c' || echo './'`uniqstr.c
cc-1185 c89: WARNING File = uniqstr.c, Line = 97
  An enumerated type is mixed with another type.

    return strcmp (m1, m2) == 0;
           ^
------------------------------------------------------------------------

In the last of these, the compiler is unhappy that the function is of
type bool, which is defined like this:

        typedef enum {false = 0, true = 1} bool;

A simple test program showed that changing the code to

        return (strcmp (m1, m2) == 0) ? true : false;

eliminates the warning.  So does adding a type cast:

        return (bool)(strcmp (m1, m2) == 0);

-------------------------------------------------------------------------------
- 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]