I forgot to mention that action_m4_define() was previously removed from
upstream flex here:
https://github.com/westes/flex/commit/925549475edb3c8921227fdd96aa0d90a2c0745a
On Sun, Aug 27, 2017 at 06:41:31PM +0800, Michael W. Bombardieri wrote:
> Hello,
>
> In lex(1) the function action_m4_define() would raise a fatal
> error if called. I couldn't see anything calling it though,
> and the program builds without it.
>
> - Michael
>
>
> Index: misc.c
> ===
> RCS file: /cvs/src/usr.bin/lex/misc.c,v
> retrieving revision 1.19
> diff -u -p -u -r1.19 misc.c
> --- misc.c19 Nov 2015 23:34:56 - 1.19
> +++ misc.c27 Aug 2017 10:27:34 -
> @@ -116,28 +116,6 @@ action_define(defname, value)
> buf_append(_buf, , 1);
> }
>
> -
> -/** Append "m4_define([[defname]],[[value]])m4_dnl\n" to the running buffer.
> - * @param defname The macro name.
> - * @param value The macro value, can be NULL, which is the same as the
> empty string.
> - */
> -void
> -action_m4_define(const char *defname, const char *value)
> -{
> - char buf[MAXLINE];
> -
> - flexfatal("DO NOT USE THIS FUNCTION!");
> -
> - if ((int) strlen(defname) > MAXLINE / 2) {
> - format_pinpoint_message(_
> - ("name \"%s\" ridiculously long"),
> - defname);
> - return;
> - }
> - snprintf(buf, sizeof(buf), "m4_define([[%s]],[[%s]])m4_dnl\n", defname,
> value ? value : "");
> - add_action(buf);
> -}
> -
> /* Append "new_text" to the running buffer. */
> void
> add_action(new_text)