Subject: Re: yacc and PR 4260
To: Jason R Thorpe <thorpej@wasabisystems.com>
From: Aymeric Vincent <Aymeric.Vincent@labri.fr>
List: tech-toolchain
Date: 12/26/2002 00:02:48
Jason R Thorpe <thorpej@wasabisystems.com> writes:

> On Sat, Dec 21, 2002 at 09:57:26PM +0100, Krister Walfridsson wrote:
> 
>  > PR 4260 notes that the yacc output has problems on platforms that do not
>  > have ANSI C realloc(3), and thus crash on realloc(NULL, x). I don't
>  > personally care about those systems, and would like to close the PR with
>  > a message saying that these systems are too old to be supported. OTOH, we
>  > do the #if __STDC__ song and dance regarding prototypes etc., so we are
>  > trying to work on at least some non-ANSI systems...
>  > 
>  > So what is the "correct" thing to do?
> 
> Desupport pre-ANSI please.

I think it's a bit sad to remove such support for the simple special
case of realloc(NULL, x) which is so easy to handle in a way that
works with pre-ANSI systems.

Yacc output is supposed to compile on as many systems as
possible. When we have a precise example of what is wrong, we could
fix it.

I was going to offer to provide a patch, but looking at the PR shows
that there's already a patch. I think we could remove the two "#if
__NetBSD__" parts of it, but it looks okay otherwise.

OTOH, if we know that yacc's output fails miserably at many other
places in a pre-ANSI environment, then I heartily agree that it's not
worth fixing.

Kind regards,
 Aymeric