[Top][All Lists]

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

Re: bison produces an output which causes gcc to hang

From: Akim Demaille
Subject: Re: bison produces an output which causes gcc to hang
Date: Thu, 18 Apr 2019 07:06:38 +0200

Hi Todd,

> Le 11 avr. 2019 à 06:30, todd freed <address@hidden> a écrit :
> When I run,
> bison -o output-file input-file
> I see references in the output file of the form,
> #line X "filename"
> Have filename=output-file.
> Shouldn't it be filename=input-file?
> Perhaps this is what changed.

I don't think anything changed in this area in a very long time.
For instance I can reproduce it with Bison 2.3, as provided by
stock MacOS.  The change is probably that GCC tries to read the
file to display caret errors, and is therefore reading stdout,
which gives you the impression it is stuck.

Bison has to emit #line both about the input file (so that errors
coming from the input file are reported against it) _and_ the
output file (so that errors coming from generated code are not
reported against the input file).

You should avoid using /dev/stdout as an output file.  Bison
would really like to know your file names.

> I tried to build bison from historical tags (v3.0 and v3.2) to check
> the previous behavior, but was not able to produce a binary that
> worked on my system.

I suspect you are on MacOS, and Apple decided to break an existing
feature (it now aborts without even an error message).  So old
versions of Bison (except the one provided by Apple) no longer work.

reply via email to

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