groff
[Top][All Lists]
Advanced

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

Re: HEAD build failure with OpenBSD yacc


From: Lennart Jablonka
Subject: Re: HEAD build failure with OpenBSD yacc
Date: Tue, 19 Mar 2024 18:49:06 +0000

Quoth G. Branden Robinson:
Yes, but do look at yacc’s output, eqn.cpp.  Using OpenBSD’s yacc, eqn.cpp
starts with this:

        #include <stdlib.h>
        #include <string.h>
        #define YYBYACC 1
        #define YYMAJOR 1
        #define YYMINOR 9
        #define YYLEX yylex()
        #define YYEMPTY -1
        #define yyclearin (yychar=(YYEMPTY))
        #define yyerrok (yyerrflag=0)
        #define YYRECOVERING() (yyerrflag!=0)
        #define YYPREFIX "yy"
        #line 19 "src/preproc/eqn/eqn.ypp"
        #ifdef HAVE_CONFIG_H
        #include <config.h>
        #endif

        #include <stdio.h>
        #include <string.h>
        #include <stdlib.h>

        #include "lib.h"
        #include "box.h"
        extern int non_empty_flag;
        int yylex();
        void yyerror(const char *);

Okay, yes, I can confirm this output and the failure.

It appears to me that byacc is just not playing nicely with Autoconf
here.  And maybe not with other tools, since it's _assuming_ that the
output will require stdlib.h and string.h.  (Its own boilerplate code
indeed might, but its aggression here has clear negative consequences.)

PerhapsThe alternative to yacc adding #include directives is yacc declaring the functions it uses by itself. It would be a little harder to have the yacc output not infringe on the user namespace in any way: If the parser wants to use memset and the user snippets want to define a macro called memset, what do you do? But I think that problem is a lot less imortant than what I perceive to be the actual problem:

Gnulib doesn’t play nice with others here, in prohibiting you from including standard library headers without doing something gnulib-specific, without including config.h. I think yacc is entitled to believe that its output is able to include standard library headers.

I don't see a path forward here except documenting that OpenBSD's byacc
is not usable for repo builds.  (Since we ship eqn.[ch]pp in
distribution archives, the impact on most users sourcing their groff
from GNU should be small.)

What do you think?

I think the gnulib headers should be fixed, somehow. I don’t know gnulib well. I also don’t know autoconf, automake, or bison well.

The gnulib headers could just include config.h directly. I don’t know. There may be more platforms with a yacc behaving similar to OpenBSD’s yacc. And I would like to be able to uninstall bison again. But I don’t care all that much.



reply via email to

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