This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

deprecated GNU ## extension used



Compiling glibc with the current GCC I get e.g. this warning:
In file included from programs/ld-numeric.c:30:
programs/linereader.h:156:59: warning: deprecated GNU ## extension used

This macro used is:
#define lr_error(lr, fmt, args...) \
  error_at_line (0, 0, lr->fname, lr->lineno, fmt, ## args)

in the following line:
	lr_error (lr, _("trailing garbage at end of line"));

Should we care about this?  I'm appending a patch for two macros to
replace the variable number of arguments with __VA_ARGS__.  What do
you think?  Is this ok?  It silences lots of warnings (also those:
"warning: pasting would not give a valid preprocessing token").

Andreas

2000-07-11  Andreas Jaeger  <aj@suse.de>

	* locale/programs/locfile.h (SYNTAX_ERROR): Use __VA_ARGS__ with
	newer gccs.
	* locale/programs/linereader.h (lr_error): Likewise.

============================================================
Index: locale/programs/locfile.h
--- locale/programs/locfile.h	2000/06/25 18:09:55	1.10
+++ locale/programs/locfile.h	2000/07/11 09:40:48
@@ -35,14 +35,24 @@
 
 
 /* Macros used in the parser.  */
-#define SYNTAX_ERROR(string, args...) \
+
+#if __GNUC_PREREQ(2,95)
+# define SYNTAX_ERROR(...) \
   do									      \
     {									      \
+      lr_error (ldfile,  __VA_ARGS__);					      \
+      lr_ignore_rest (ldfile, 0);					      \
+    }									      \
+  while (0)
+#else
+# define SYNTAX_ERROR(string, args...) \
+  do									      \
+    {									      \
       lr_error (ldfile, string, ## args);				      \
       lr_ignore_rest (ldfile, 0);					      \
     }									      \
   while (0)
-
+#endif
 
 /* General handling of `copy'.  */
 static inline void
============================================================
Index: locale/programs/linereader.h
--- locale/programs/linereader.h	1999/08/31 06:47:28	1.4
+++ locale/programs/linereader.h	2000/07/11 09:40:48
@@ -92,10 +92,13 @@
 			       const struct charmap_t *charmap,
 			       const struct repertoire_t *repertoire);
 
-
-#define lr_error(lr, fmt, args...) \
+#if __GNUC_PREREQ(2,95)
+# define lr_error(lr, ...) \
+  error_at_line (0, 0, lr->fname, lr->lineno, __VA_ARGS__)
+#else
+# define lr_error(lr, fmt, args...) \
   error_at_line (0, 0, lr->fname, lr->lineno, fmt, ## args)
-
+#endif
 
 
 static inline int

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]