tests: address portability issues about strdup

Reported by Dennis Clarke
<https://lists.gnu.org/r/bug-bison/2021-10/msg00005.html>.
In particular
<https://lists.gnu.org/r/bug-bison/2021-10/msg00023.html>.

* doc/bison.texi, examples/c/glr/c++-types.y,
* examples/c/bistromathic/parse.y tests/testsuite.h:
Define _XOPEN_SOURCE to 600, to get a strdup that works on Solaris.

* tests/glr-regression.at: Use strdup freely.
This commit is contained in:
Akim Demaille
2021-10-23 06:01:44 +02:00
parent c9b5b46d74
commit c83425ef4e
5 changed files with 23 additions and 4 deletions

View File

@@ -295,9 +295,7 @@ FILE *input;
else
{
assert (strlen (buf) < sizeof buf - 1);
char *s = YY_CAST (char *, malloc (strlen (buf) + 1));
strcpy (s, buf);
]AT_VAL[ = s;
]AT_VAL[ = strdup (buf);
return 'V';
}
break;