[Top][All Lists]

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

Bison-1.28a Bugs

From: Hans Aberg
Subject: Bison-1.28a Bugs
Date: Thu, 5 Oct 2000 00:39:50 +0200

About files in the "src" directory:

-- Change all #include <config.h> to #include "config.h".

-- On config.h (which I must edit by hand):
  -- I had to put in
#ifndef CONFIG_H
#define CONFIG_H
#endif  /* CONFIG_H */

  -- I am worrying about constructs such as
/* Define to `unsigned' if <sys/types.h> doesn't define.  */
#undef size_t
  because, if not edited, it means the name is undefined. Those I changed to
/* Define to `unsigned' if <sys/types.h> doesn't define.  */
#if 0
#undef size_t

  -- I could not find any instance of the HAVE_DONE_WORKING_REALLOC_CHECK
name in the sources.

  -- Same problem as before: If one merely writes #define FOO_BAR, there
are later illegal used of type #if FOO_BAR. Therefore either the text of
this file should be changed to "Define to 1 if ..." or all uses should be
of the form
#if ... defined(FOO_BAR) ...

  -- Some missing macros in the new config.hin (shown with my values)
#define LOCALEDIR ":"   -- Important as MacOS use ":" here.

/* The location of the simple parser (bison.simple).  */
#define XPFILE "bison.simple"

/* The location of the semantic parser (bison.hairy).  */
#define XPFILE1 "bison.hairy"

  -- It says that VERSION isn't used in Bison, but it is used by version()
in getargs.c. So
#define VERSION "1.28a"


File complain.h: Add #include "system.h" (because of the macro __attribute__).

File files.h: Add #include "system.h" (because of the macro PARAMS).

I get a lot of warnings:
Warning : identifier 'bool' redeclared
system.h line 163   typedef int bool;

-- xstrdup() was not in src, but in lib/xstrdup.c. Then it includes
<sys/types.h> which is not necessary, at least not under ISO C. Also
xstrdup does not have a prototype.

-- xrealloc() was not in src, but in lib/xmalloc.c.  Then it includes
<sys/types.h> which is not necessary, at least not under ISO C.

-- I also had to include from lib the files getopt.c and getopt1.c.

-- Because some C library files show up as though they were project files,
I think you might have used #include "..." instead of the correct #include
<...> at some places in the code.

-- It is not clear to me, what is complain(), a warning, that is, something
that will produce a compiled output, or an error, something that will abort

-- I still had to use my stuff around exit():
void Exit(int status);
#define exit Exit
void Exit(int status) {
    done();  /* Was registred by atexit() */
    longjmp(main_env, (status == 0)? INT_MAX : status);

A more clever way would have been to register another function with
atexit() which is doing a longjump, but that way I cannot pick up the
status that exit() gets as an argument.

-- File bison.s1:
  -- The arguments of the #line directives have been lost. I entered:
line 2:    #line 3 "bison.simple"
line 240:  #line 241 "bison.simple"ยจ
line 614:  #line 615 "bison.simple"

  -- As before, I added to bison.simple:
#if __MWERKS__ && macintosh
#include <alloca.h>
#include <stdlib.h>
before the first YYSTACK_USE_ALLOCA in that file. (And because of that my
#line numbers become different than if this stuff wasn't put in these

-- But after doing those changes, the rpcalc example from the bison docs
compiled as before.

-- I will pack down my altered sources and mail them to you so that you can
check the diff's (I do not have access to the program "diff" so this is the
only way).

I will have to fiddle around a bit more with the code in order to see that
it is all right.

  Hans Aberg

reply via email to

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