gnulib: update, and use the attribute module

* gnulib: Update.
* bootstrap.conf: Use attribute.
* src/system.h: Remove macros for attributes.
Adjust dependencies.
* src/scan-gram.l (DEPRECATED): Rename as...
(DEPRECATED_DIRECTIVE): this, to avoid the clash with the DEPRECATED macro.
This commit is contained in:
Akim Demaille
2020-05-08 17:35:23 +02:00
parent f049a57eec
commit fb49a10e2c
8 changed files with 22 additions and 40 deletions

View File

@@ -132,7 +132,7 @@ bool warning_is_enabled (warnings flags);
/** Make a complaint, with maybe a location. */
void complain (location const *loc, warnings flags, char const *message, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
ATTRIBUTE_FORMAT ((__printf__, 3, 4));
/** Likewise, but with an \a argc/argv interface. */
void complain_args (location const *loc, warnings w,
@@ -141,7 +141,7 @@ void complain_args (location const *loc, warnings w,
/** Make a subcomplain with location and note. */
void subcomplain (location const *loc, warnings flags,
char const *message, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
ATTRIBUTE_FORMAT ((__printf__, 3, 4));
/** GNU Bison extension not valid with POSIX Yacc. */

View File

@@ -30,6 +30,7 @@
#include <getopt.h>
#include <progname.h>
#include <quote.h>
#include <stdnoreturn.h>
#include <textstyle.h>
#include "complain.h"
@@ -151,8 +152,8 @@ flags_argmatch (const char *opt,
*/
#define FLAGS_ARGMATCH(FlagName, Args, All) \
flags_argmatch ("--" #FlagName, \
(xargmatch_fn*) argmatch_## FlagName ## _value, \
argmatch_## FlagName ## _usage, \
(xargmatch_fn*) argmatch_## FlagName ## _value, \
argmatch_ ## FlagName ## _usage, \
All, &FlagName ## _flag, Args)
/*---------------------.
@@ -337,7 +338,8 @@ const argmatch_feature_group_type argmatch_feature_group =
| Display the help message and exit STATUS. |
`-------------------------------------------*/
static void usage (int) ATTRIBUTE_NORETURN;
_Noreturn
static void usage (int);
static void
usage (int status)
@@ -860,7 +862,7 @@ getargs (int argc, char *argv[])
void
tr (char *s, char from, char to)
{
for (; *s; s++)
for (; *s; ++s)
if (*s == from)
*s = to;
}

View File

@@ -74,7 +74,7 @@ static boundary scanner_cursor;
yyless (0); \
} while (0)
#define DEPRECATED(Msg) \
#define DEPRECATED_DIRECTIVE(Msg) \
do { \
deprecated_directive (loc, yytext, Msg); \
scanner_cursor.column -= mbsnwidth (Msg, strlen (Msg), 0); \
@@ -295,15 +295,15 @@ eqopt ({sp}=)?
"%name"[-_]"prefix"{eqopt}{sp} RETURN_VALUE (PERCENT_NAME_PREFIX, uniqstr_new (yytext));
/* Deprecated since Bison 2.7.90, 2012. */
"%default"[-_]"prec" DEPRECATED ("%default-prec");
"%default"[-_]"prec" DEPRECATED_DIRECTIVE ("%default-prec");
"%error"[-_]"verbose" RETURN_VALUE (PERCENT_ERROR_VERBOSE, uniqstr_new (yytext));
"%expect"[-_]"rr" DEPRECATED ("%expect-rr");
"%expect"[-_]"rr" DEPRECATED_DIRECTIVE ("%expect-rr");
"%file-prefix"{eqopt} RETURN_VALUE (PERCENT_FILE_PREFIX, uniqstr_new (yytext));
"%fixed"[-_]"output"[-_]"files" DEPRECATED ("%output \"y.tab.c\"");
"%no"[-_]"default"[-_]"prec" DEPRECATED ("%no-default-prec");
"%no"[-_]"lines" DEPRECATED ("%no-lines");
"%output"{eqopt} DEPRECATED ("%output");
"%token"[-_]"table" DEPRECATED ("%token-table");
"%fixed"[-_]"output"[-_]"files" DEPRECATED_DIRECTIVE ("%output \"y.tab.c\"");
"%no"[-_]"default"[-_]"prec" DEPRECATED_DIRECTIVE ("%no-default-prec");
"%no"[-_]"lines" DEPRECATED_DIRECTIVE ("%no-lines");
"%output"{eqopt} DEPRECATED_DIRECTIVE ("%output");
"%token"[-_]"table" DEPRECATED_DIRECTIVE ("%token-table");
"%"{id} {
complain (loc, complaint, _("invalid directive: %s"), quote (yytext));

View File

@@ -110,28 +110,7 @@ typedef size_t uintptr_t;
Bison's performance anyway. */
# define PACIFY_CC(Code) Code
# ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if (! defined __GNUC__ || __GNUC__ < 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
# define __attribute__(Spec) /* empty */
# endif
# endif
/* The __-protected variants of 'format' and 'printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format
# define __printf__ printf
# endif
# ifndef ATTRIBUTE_NORETURN
# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
# endif
# ifndef ATTRIBUTE_UNUSED
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# endif
# include <attribute.h>
/*------.

View File

@@ -21,6 +21,7 @@
#include <config.h>
#include "system.h"
#include <attribute.h>
#include <error.h>
#include <hash.h>
#include <quotearg.h>
@@ -117,12 +118,11 @@ uniqstr_print (uniqstr ustr)
}
static bool
uniqstr_print_processor (void *ustr, void *null ATTRIBUTE_UNUSED)
uniqstr_print_processor (void *ustr, void *null MAYBE_UNUSED)
{
return uniqstr_print (ustr);
}
int
uniqstr_cmp (uniqstr l, uniqstr r)
{