#include "error.h"
#include "error-progname.h"
+#include "flexmember.h"
#include "xalloc.h"
#include "xsize.h"
{
struct arglist_parser *ap =
(struct arglist_parser *)
- xmalloc (offsetof (struct arglist_parser, alternative[0]));
+ xmalloc (FLEXNSIZEOF (struct arglist_parser, alternative, 0));
ap->mlp = mlp;
ap->keyword = NULL;
{
struct arglist_parser *ap =
(struct arglist_parser *)
- xmalloc (xsum (sizeof (struct arglist_parser),
- xtimes (shapes->nshapes - 1,
- sizeof (struct partial_call))));
+ xmalloc (FLEXNSIZEOF (struct arglist_parser, alternative,
+ shapes->nshapes));
size_t i;
ap->mlp = mlp;
{
struct arglist_parser *copy =
(struct arglist_parser *)
- xmalloc (xsum (sizeof (struct arglist_parser) - sizeof (struct partial_call),
- xtimes (ap->nalternatives, sizeof (struct partial_call))));
+ xmalloc (FLEXNSIZEOF (struct arglist_parser, alternative,
+ ap->nalternatives));
size_t i;
copy->mlp = ap->mlp;
/* Resolving ambiguity of argument lists: Progressive parsing of an
argument list, keeping track of all possibilities.
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
size_t keyword_len; /* the keyword's length */
bool next_is_msgctxt; /* true if the next argument is the msgctxt */
size_t nalternatives; /* number of partial_call alternatives */
- struct partial_call alternative[1]; /* partial_call alternatives */
+ struct partial_call alternative[FLEXIBLE_ARRAY_MEMBER]; /* partial_call alternatives */
};
/* Creates a fresh arglist_parser recognizing calls.