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

@@ -17,7 +17,7 @@
# gnulib modules used by this package. # gnulib modules used by this package.
gnulib_modules=' gnulib_modules='
argmatch array-list assert assure argmatch array-list assert assure attribute
bitsetv bitsetv
calloc-posix close closeout config-h c-strcase calloc-posix close closeout config-h c-strcase
configmake configmake

2
gnulib

Submodule gnulib updated: 2ac33b29fc...2e3f0c9108

1
lib/.gitignore vendored
View File

@@ -18,6 +18,7 @@
/asnprintf.c /asnprintf.c
/asprintf.c /asprintf.c
/assure.h /assure.h
/attribute.h
/basename-lgpl.c /basename-lgpl.c
/basename.c /basename.c
/binary-io.c /binary-io.c

View File

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

View File

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

View File

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

View File

@@ -110,28 +110,7 @@ typedef size_t uintptr_t;
Bison's performance anyway. */ Bison's performance anyway. */
# define PACIFY_CC(Code) Code # define PACIFY_CC(Code) Code
# ifndef __attribute__ # include <attribute.h>
/* 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
/*------. /*------.

View File

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