public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Function attributes: use shorter versions of the format macros
  2014-12-01 15:58 [PATCH 1/2] remote-utils.c: remove unused gdb_stdlog Cleber Rosa
@ 2014-12-01 15:58 ` Cleber Rosa
  2014-12-01 20:39   ` Sergio Durigan Junior
  2014-12-03 10:31   ` Joel Brobecker
  2014-12-01 20:34 ` [PATCH 1/2] remote-utils.c: remove unused gdb_stdlog Sergio Durigan Junior
  1 sibling, 2 replies; 12+ messages in thread
From: Cleber Rosa @ 2014-12-01 15:58 UTC (permalink / raw)
  To: gdb-patches, cleber; +Cc: Cleber Rosa

For consistency sake, use the shorter versions of the function attribute
format macros.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 gdb/ChangeLog                  | 20 ++++++++++++++++++++
 gdb/ada-lang.c                 |  2 +-
 gdb/cli-out.c                  |  2 +-
 gdb/common/agent.c             |  2 +-
 gdb/common/buffer.h            |  2 +-
 gdb/common/common-debug.h      |  2 +-
 gdb/common/common-exceptions.h |  4 ++--
 gdb/common/common-utils.h      |  4 ++--
 gdb/common/errors.h            |  8 ++++----
 gdb/complaints.h               |  4 ++--
 gdb/disasm.c                   |  4 ++--
 gdb/exceptions.h               |  2 +-
 gdb/gdbserver/ChangeLog        |  5 +++++
 gdb/gdbserver/ax.c             |  2 +-
 gdb/gdbserver/tracepoint.c     |  2 +-
 gdb/language.h                 |  2 +-
 gdb/monitor.c                  |  2 +-
 gdb/parser-defs.h              |  2 +-
 gdb/serial.h                   |  2 +-
 gdb/ui-out.h                   |  4 ++--
 gdb/utils.h                    | 20 ++++++++++----------
 21 files changed, 61 insertions(+), 36 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 13346fa..5aebcb0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,23 @@
+2014-12-01  Cleber Rosa  <cleber@redhat.com>
+
+	* ada-lang.c: use shorter versions of function attributes macros.
+	* cli-out.c: Likewise.
+	* common/agent.c: Likewise.
+	* common/buffer.h: Likewise.
+	* common/common-debug.h: Likewise.
+	* common/common-exceptions.h: Likewise.
+	* common/common-utils.h: Likewise.
+	* common/errors.h: Likewise.
+	* complaints.h: Likewise.
+	* disasm.c: Likewise.
+	* exceptions.h: Likewise.
+	* language.h: Likewise.
+	* monitor.c: Likewise.
+	* parser-defs.h: Likewise.
+	* serial.h: Likewise.
+	* ui-out.h: Likewise.
+	* utils.h: Likewise.
+
 2014-12-01  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* objfiles.c (allocate_objfile): Remove duplicate comment.
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 3a024d9..584f1a4 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -721,7 +721,7 @@ cond_offset_target (CORE_ADDR address, long offset)
 
 /* FIXME: cagney/2004-10-10: This function is mimicking the behavior
    provided by "complaint".  */
-static void lim_warning (const char *format, ...) ATTRIBUTE_PRINTF (1, 2);
+static void lim_warning (const char *format, ...) ATTRIBUTE_PRINTF_1;
 
 static void
 lim_warning (const char *format, ...)
diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index 4961d8a..9314cad 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -36,7 +36,7 @@ static void field_separator (void);
 
 static void out_field_fmt (struct ui_out *uiout, int fldno,
 			   const char *fldname,
-			   const char *format,...) ATTRIBUTE_PRINTF (4, 5);
+			   const char *format,...) ATTRIBUTE_PRINTF_4;
 
 /* The destructor.  */
 
diff --git a/gdb/common/agent.c b/gdb/common/agent.c
index 0c3d7a3..2d9ad91 100644
--- a/gdb/common/agent.c
+++ b/gdb/common/agent.c
@@ -28,7 +28,7 @@ int debug_agent = 0;
 
 /* A stdarg wrapper for debug_vprintf.  */
 
-static void ATTRIBUTE_PRINTF (1, 2)
+static void ATTRIBUTE_PRINTF_1
 debug_agent_printf (const char *fmt, ...)
 {
   va_list ap;
diff --git a/gdb/common/buffer.h b/gdb/common/buffer.h
index 1c748dd..65079e2 100644
--- a/gdb/common/buffer.h
+++ b/gdb/common/buffer.h
@@ -49,7 +49,7 @@ char* buffer_finish (struct buffer *buffer);
    %x - grow an unsigned integer formatted in hexadecimal in BUFFER.
    %o - grow an unsigned integer formatted in octal in BUFFER.  */
 void buffer_xml_printf (struct buffer *buffer, const char *format, ...)
-  ATTRIBUTE_PRINTF (2, 3);
+  ATTRIBUTE_PRINTF_2;
 
 #define buffer_grow_str(BUFFER,STRING)		\
   buffer_grow (BUFFER, STRING, strlen (STRING))
diff --git a/gdb/common/common-debug.h b/gdb/common/common-debug.h
index 348b0e3..99eb9ee 100644
--- a/gdb/common/common-debug.h
+++ b/gdb/common/common-debug.h
@@ -29,7 +29,7 @@ extern int show_debug_regs;
    debugging output for the client.  */
 
 extern void debug_printf (const char *format, ...)
-     ATTRIBUTE_PRINTF (1, 2);
+     ATTRIBUTE_PRINTF_1;
 
 /* Print a formatted message to the appropriate channel for
    debugging output for the client.  This function must be
diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h
index 5f750c3..34396e0 100644
--- a/gdb/common/common-exceptions.h
+++ b/gdb/common/common-exceptions.h
@@ -178,8 +178,8 @@ extern void throw_verror (enum errors, const char *fmt, va_list ap)
 extern void throw_vquit (const char *fmt, va_list ap)
      ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0);
 extern void throw_error (enum errors error, const char *fmt, ...)
-     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 3);
+     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_2;
 extern void throw_quit (const char *fmt, ...)
-     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
+     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1;
 
 #endif /* COMMON_EXCEPTIONS_H */
diff --git a/gdb/common/common-utils.h b/gdb/common/common-utils.h
index 67615ba..9df5d38 100644
--- a/gdb/common/common-utils.h
+++ b/gdb/common/common-utils.h
@@ -48,13 +48,13 @@ void xfree (void *);
 
 /* Like asprintf and vasprintf, but return the string, throw an error
    if no memory.  */
-char *xstrprintf (const char *format, ...) ATTRIBUTE_PRINTF (1, 2);
+char *xstrprintf (const char *format, ...) ATTRIBUTE_PRINTF_1;
 char *xstrvprintf (const char *format, va_list ap)
      ATTRIBUTE_PRINTF (1, 0);
 
 /* Like snprintf, but throw an error if the output buffer is too small.  */
 int xsnprintf (char *str, size_t size, const char *format, ...)
-     ATTRIBUTE_PRINTF (3, 4);
+     ATTRIBUTE_PRINTF_3;
 
 /* Make a copy of the string at PTR with LEN characters
    (and add a null character at the end in the copy).
diff --git a/gdb/common/errors.h b/gdb/common/errors.h
index 88d77e5..fb3df0b 100644
--- a/gdb/common/errors.h
+++ b/gdb/common/errors.h
@@ -26,7 +26,7 @@
    provided by the client.  */
 
 extern void warning (const char *fmt, ...)
-     ATTRIBUTE_PRINTF (1, 2);
+     ATTRIBUTE_PRINTF_1;
 
 extern void vwarning (const char *fmt, va_list args)
      ATTRIBUTE_PRINTF (1, 0);
@@ -37,7 +37,7 @@ extern void vwarning (const char *fmt, va_list args)
    return.  The function "verror" must be provided by the client.  */
 
 extern void error (const char *fmt, ...)
-     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
+     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1;
 
 extern void verror (const char *fmt, va_list args)
      ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0);
@@ -53,7 +53,7 @@ extern void verror (const char *fmt, va_list args)
 
 extern void internal_error (const char *file, int line,
 			    const char *fmt, ...)
-     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 4);
+     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_3;
 
 extern void internal_verror (const char *file, int line,
 			     const char *fmt, va_list args)
@@ -68,7 +68,7 @@ extern void internal_verror (const char *file, int line,
 
 extern void internal_warning (const char *file, int line,
 			      const char *fmt, ...)
-     ATTRIBUTE_PRINTF (3, 4);
+     ATTRIBUTE_PRINTF_3;
 
 extern void internal_vwarning (const char *file, int line,
 			       const char *fmt, va_list args)
diff --git a/gdb/complaints.h b/gdb/complaints.h
index a848144..7fc8063 100644
--- a/gdb/complaints.h
+++ b/gdb/complaints.h
@@ -31,11 +31,11 @@ extern struct complaints *symfile_complaints;
 /* Register a complaint.  */
 extern void complaint (struct complaints **complaints,
 		       const char *fmt,
-		       ...) ATTRIBUTE_PRINTF (2, 3);
+		       ...) ATTRIBUTE_PRINTF_2;
 extern void internal_complaint (struct complaints **complaints,
 				const char *file, int line,
 				const char *fmt,
-				...) ATTRIBUTE_PRINTF (4, 5);
+				...) ATTRIBUTE_PRINTF_4;
 
 /* Clear out / initialize all complaint counters that have ever been
    incremented.  If LESS_VERBOSE is 1, be less verbose about
diff --git a/gdb/disasm.c b/gdb/disasm.c
index 52d6a0f..33c6778 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -363,7 +363,7 @@ do_assembly_only (struct gdbarch *gdbarch, struct ui_out *uiout,
 /* Initialize the disassemble info struct ready for the specified
    stream.  */
 
-static int ATTRIBUTE_PRINTF (2, 3)
+static int ATTRIBUTE_PRINTF_2
 fprintf_disasm (void *stream, const char *format, ...)
 {
   va_list args;
@@ -487,7 +487,7 @@ gdb_insn_length (struct gdbarch *gdbarch, CORE_ADDR addr)
    nop, we don't want to print anything, we just want to compute the
    length of the insn.  */
 
-static int ATTRIBUTE_PRINTF (2, 3)
+static int ATTRIBUTE_PRINTF_2
 gdb_buffered_insn_length_fprintf (void *stream, const char *format, ...)
 {
   return 0;
diff --git a/gdb/exceptions.h b/gdb/exceptions.h
index f4d62a6..2465771 100644
--- a/gdb/exceptions.h
+++ b/gdb/exceptions.h
@@ -30,7 +30,7 @@ extern const struct gdb_exception exception_none;
 extern void exception_print (struct ui_file *file, struct gdb_exception e);
 extern void exception_fprintf (struct ui_file *file, struct gdb_exception e,
 			       const char *prefix,
-			       ...) ATTRIBUTE_PRINTF (3, 4);
+			       ...) ATTRIBUTE_PRINTF_3;
 
 /* Call FUNC(UIOUT, FUNC_ARGS) but wrapped within an exception
    handler.  If an exception (enum return_reason) is thrown using
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 0e110e7..113a1ea 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,10 @@
 2014-12-01  Cleber Rosa  <cleber@redhat.com>
 
+	* ax.c: use shorter versions of function attributes macros.
+	* tracepoint.c: Likewise.
+
+2014-12-01  Cleber Rosa  <cleber@redhat.com>
+
         * remote-utils.c: Remove unused variable.
 
 2014-11-28  Yao Qi  <yao@codesourcery.com>
diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c
index 8b28c72..f5c6179 100644
--- a/gdb/gdbserver/ax.c
+++ b/gdb/gdbserver/ax.c
@@ -22,7 +22,7 @@
 #include "tracepoint.h"
 #include "rsp-low.h"
 
-static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF_1;
 
 #ifdef IN_PROCESS_AGENT
 int debug_agent = 0;
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index b6ab53f..278fad9 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -63,7 +63,7 @@
 
 #ifdef IN_PROCESS_AGENT
 
-static void trace_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+static void trace_vdebug (const char *, ...) ATTRIBUTE_PRINTF_1;
 
 static void
 trace_vdebug (const char *fmt, ...)
diff --git a/gdb/language.h b/gdb/language.h
index 73619ca..a4bd02f 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -477,7 +477,7 @@ extern int pointer_type (struct type *);
 
 /* Error messages */
 
-extern void range_error (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+extern void range_error (const char *, ...) ATTRIBUTE_PRINTF_1;
 
 /* Data:  Does this value represent "truth" to the current language?  */
 
diff --git a/gdb/monitor.c b/gdb/monitor.c
index d9e7b0a..66e2624 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -118,7 +118,7 @@ static ptid_t monitor_ptid;
 /* Monitor specific debugging information.  Typically only useful to
    the developer of a new monitor interface.  */
 
-static void monitor_debug (const char *fmt, ...) ATTRIBUTE_PRINTF (1, 2);
+static void monitor_debug (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
 
 static unsigned int monitor_debug_p = 0;
 
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index 2ba6e05..044e534 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -382,7 +382,7 @@ extern void print_subexp_standard (struct expression *, int *,
 /* Function used to avoid direct calls to fprintf
    in the code generated by the bison parser.  */
 
-extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
+extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF_2;
 
 extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile);
 
diff --git a/gdb/serial.h b/gdb/serial.h
index f4ab31e..7b01e96 100644
--- a/gdb/serial.h
+++ b/gdb/serial.h
@@ -112,7 +112,7 @@ extern int serial_write (struct serial *scb, const void *buf, size_t count);
 /* Write a printf style string onto the serial port.  */
 
 extern void serial_printf (struct serial *desc, 
-			   const char *,...) ATTRIBUTE_PRINTF (2, 3);
+			   const char *,...) ATTRIBUTE_PRINTF_2;
 
 /* Allow pending output to drain.  */
 
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index cbd0b9b..f566dda 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -114,7 +114,7 @@ extern void ui_out_field_stream (struct ui_out *uiout, const char *fldname,
 
 extern void ui_out_field_fmt (struct ui_out *uiout, const char *fldname,
 			      const char *format, ...)
-     ATTRIBUTE_PRINTF (3, 4);
+     ATTRIBUTE_PRINTF_3;
 
 extern void ui_out_field_skip (struct ui_out *uiout, const char *fldname);
 
@@ -124,7 +124,7 @@ extern void ui_out_text (struct ui_out *uiout, const char *string);
 
 extern void ui_out_message (struct ui_out *uiout, int verbosity,
 			    const char *format, ...)
-     ATTRIBUTE_PRINTF (3, 4);
+     ATTRIBUTE_PRINTF_3;
 
 extern void ui_out_wrap_hint (struct ui_out *uiout, char *identstring);
 
diff --git a/gdb/utils.h b/gdb/utils.h
index 1568011..175a15e 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -145,9 +145,9 @@ char *ldirname (const char *filename);
 
 struct ui_file;
 
-extern int query (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
-extern int nquery (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
-extern int yquery (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+extern int query (const char *, ...) ATTRIBUTE_PRINTF_1;
+extern int nquery (const char *, ...) ATTRIBUTE_PRINTF_1;
+extern int yquery (const char *, ...) ATTRIBUTE_PRINTF_1;
 
 extern void begin_line (void);
 
@@ -206,14 +206,14 @@ extern void vfprintf_filtered (struct ui_file *, const char *, va_list)
   ATTRIBUTE_PRINTF (2, 0);
 
 extern void fprintf_filtered (struct ui_file *, const char *, ...)
-  ATTRIBUTE_PRINTF (2, 3);
+  ATTRIBUTE_PRINTF_2;
 
 extern void fprintfi_filtered (int, struct ui_file *, const char *, ...)
-  ATTRIBUTE_PRINTF (3, 4);
+  ATTRIBUTE_PRINTF_3;
 
-extern void printf_filtered (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+extern void printf_filtered (const char *, ...) ATTRIBUTE_PRINTF_1;
 
-extern void printfi_filtered (int, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
+extern void printfi_filtered (int, const char *, ...) ATTRIBUTE_PRINTF_2;
 
 extern void vprintf_unfiltered (const char *, va_list) ATTRIBUTE_PRINTF (1, 0);
 
@@ -221,9 +221,9 @@ extern void vfprintf_unfiltered (struct ui_file *, const char *, va_list)
   ATTRIBUTE_PRINTF (2, 0);
 
 extern void fprintf_unfiltered (struct ui_file *, const char *, ...)
-  ATTRIBUTE_PRINTF (2, 3);
+  ATTRIBUTE_PRINTF_2;
 
-extern void printf_unfiltered (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+extern void printf_unfiltered (const char *, ...) ATTRIBUTE_PRINTF_1;
 
 extern void print_spaces (int, struct ui_file *);
 
@@ -290,7 +290,7 @@ extern void demangler_vwarning (const char *file, int line,
      ATTRIBUTE_PRINTF (3, 0);
 
 extern void demangler_warning (const char *file, int line,
-			      const char *, ...) ATTRIBUTE_PRINTF (3, 4);
+		              const char *, ...) ATTRIBUTE_PRINTF_3;
 
 \f
 /* Misc. utilities.  */
-- 
1.9.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] remote-utils.c: remove unused gdb_stdlog
@ 2014-12-01 15:58 Cleber Rosa
  2014-12-01 15:58 ` [PATCH 2/2] Function attributes: use shorter versions of the format macros Cleber Rosa
  2014-12-01 20:34 ` [PATCH 1/2] remote-utils.c: remove unused gdb_stdlog Sergio Durigan Junior
  0 siblings, 2 replies; 12+ messages in thread
From: Cleber Rosa @ 2014-12-01 15:58 UTC (permalink / raw)
  To: gdb-patches, cleber; +Cc: Cleber Rosa

It looks like this came from an attempt to mimmic gdb/main.c, which
has gdb_stdlog, gdb_stderr, gdb_stdout, etc. But in reality, it's
not being used on gdbserver.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 gdb/gdbserver/ChangeLog      | 4 ++++
 gdb/gdbserver/remote-utils.c | 1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index e378a5f..0e110e7 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-01  Cleber Rosa  <cleber@redhat.com>
+
+        * remote-utils.c: Remove unused variable.
+
 2014-11-28  Yao Qi  <yao@codesourcery.com>
 
 	* configure.ac(AC_CHECK_FUNCS): Remove readlink.
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 373fc15..442e94e 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -100,7 +100,6 @@ struct sym_cache
 };
 
 int remote_debug = 0;
-struct ui_file *gdb_stdlog;
 
 static int remote_is_stdio = 0;
 
-- 
1.9.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] remote-utils.c: remove unused gdb_stdlog
  2014-12-01 15:58 [PATCH 1/2] remote-utils.c: remove unused gdb_stdlog Cleber Rosa
  2014-12-01 15:58 ` [PATCH 2/2] Function attributes: use shorter versions of the format macros Cleber Rosa
@ 2014-12-01 20:34 ` Sergio Durigan Junior
  2014-12-03 10:12   ` Joel Brobecker
  1 sibling, 1 reply; 12+ messages in thread
From: Sergio Durigan Junior @ 2014-12-01 20:34 UTC (permalink / raw)
  To: Cleber Rosa; +Cc: gdb-patches, cleber

On Monday, December 01 2014, Cleber Rosa wrote:

> It looks like this came from an attempt to mimmic gdb/main.c, which
> has gdb_stdlog, gdb_stderr, gdb_stdout, etc. But in reality, it's
> not being used on gdbserver.

Heya :-).

Thanks for sending the patch upstream.  As we have already discussed on
private, this looks almost obvious to me, but let's wait for some
maintainer to approve.  Meanwhile...

> Signed-off-by: Cleber Rosa <crosa@redhat.com>

We don't use Signed-off-by here, but it shouldn't do any harm to keep it
in the patch.

> ---
>  gdb/gdbserver/ChangeLog      | 4 ++++
>  gdb/gdbserver/remote-utils.c | 1 -
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
> index e378a5f..0e110e7 100644
> --- a/gdb/gdbserver/ChangeLog
> +++ b/gdb/gdbserver/ChangeLog
> @@ -1,3 +1,7 @@
> +2014-12-01  Cleber Rosa  <cleber@redhat.com>
> +
> +        * remote-utils.c: Remove unused variable.

Every entry in the ChangeLog should be indented using TABs, and not
spaces.  You could also specify *which* unused variable you are
removing.  Thus:

	* remote-utils.c: Remove unused variable "gdb_stdlog".

> +
>  2014-11-28  Yao Qi  <yao@codesourcery.com>
>  
>  	* configure.ac(AC_CHECK_FUNCS): Remove readlink.
> diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
> index 373fc15..442e94e 100644
> --- a/gdb/gdbserver/remote-utils.c
> +++ b/gdb/gdbserver/remote-utils.c
> @@ -100,7 +100,6 @@ struct sym_cache
>  };
>  
>  int remote_debug = 0;
> -struct ui_file *gdb_stdlog;
>  
>  static int remote_is_stdio = 0;
>  
> -- 
> 1.9.3

Thanks,

-- 
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] Function attributes: use shorter versions of the format macros
  2014-12-01 15:58 ` [PATCH 2/2] Function attributes: use shorter versions of the format macros Cleber Rosa
@ 2014-12-01 20:39   ` Sergio Durigan Junior
  2014-12-03 10:31   ` Joel Brobecker
  1 sibling, 0 replies; 12+ messages in thread
From: Sergio Durigan Junior @ 2014-12-01 20:39 UTC (permalink / raw)
  To: Cleber Rosa; +Cc: gdb-patches, cleber

On Monday, December 01 2014, Cleber Rosa wrote:

> For consistency sake, use the shorter versions of the function attribute
> format macros.

Thanks for the patch.  It still looks good to me; let's wait for a
maintainer to reply :-).

Just a few comments about the ChangeLog entry.

> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>  gdb/ChangeLog                  | 20 ++++++++++++++++++++
>  gdb/ada-lang.c                 |  2 +-
>  gdb/cli-out.c                  |  2 +-
>  gdb/common/agent.c             |  2 +-
>  gdb/common/buffer.h            |  2 +-
>  gdb/common/common-debug.h      |  2 +-
>  gdb/common/common-exceptions.h |  4 ++--
>  gdb/common/common-utils.h      |  4 ++--
>  gdb/common/errors.h            |  8 ++++----
>  gdb/complaints.h               |  4 ++--
>  gdb/disasm.c                   |  4 ++--
>  gdb/exceptions.h               |  2 +-
>  gdb/gdbserver/ChangeLog        |  5 +++++
>  gdb/gdbserver/ax.c             |  2 +-
>  gdb/gdbserver/tracepoint.c     |  2 +-
>  gdb/language.h                 |  2 +-
>  gdb/monitor.c                  |  2 +-
>  gdb/parser-defs.h              |  2 +-
>  gdb/serial.h                   |  2 +-
>  gdb/ui-out.h                   |  4 ++--
>  gdb/utils.h                    | 20 ++++++++++----------
>  21 files changed, 61 insertions(+), 36 deletions(-)
>
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 13346fa..5aebcb0 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,23 @@
> +2014-12-01  Cleber Rosa  <cleber@redhat.com>
> +
> +	* ada-lang.c: use shorter versions of function attributes macros.

Capital "U" in the beginning of the sentence.  You should also specify
which functions/prototypes were modified.  Therefore, in this case, you
could write:

	* ada-lang.c (lim_warning): Use a shorter version of the
	ATTRIBUTE_PRINTF macro.

> +	* cli-out.c: Likewise.

And here:

	* cli-out.c (out_field_fmt): Likewise.

And so on...

Yeah, it can be a bit annoying, sorry about that :-/.

Other than that, your patch looks fine (and obvious) to me.

> +	* common/agent.c: Likewise.
> +	* common/buffer.h: Likewise.
> +	* common/common-debug.h: Likewise.
> +	* common/common-exceptions.h: Likewise.
> +	* common/common-utils.h: Likewise.
> +	* common/errors.h: Likewise.
> +	* complaints.h: Likewise.
> +	* disasm.c: Likewise.
> +	* exceptions.h: Likewise.
> +	* language.h: Likewise.
> +	* monitor.c: Likewise.
> +	* parser-defs.h: Likewise.
> +	* serial.h: Likewise.
> +	* ui-out.h: Likewise.
> +	* utils.h: Likewise.
> +
>  2014-12-01  Simon Marchi  <simon.marchi@ericsson.com>
>  
>  	* objfiles.c (allocate_objfile): Remove duplicate comment.
> diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
> index 3a024d9..584f1a4 100644
> --- a/gdb/ada-lang.c
> +++ b/gdb/ada-lang.c
> @@ -721,7 +721,7 @@ cond_offset_target (CORE_ADDR address, long offset)
>  
>  /* FIXME: cagney/2004-10-10: This function is mimicking the behavior
>     provided by "complaint".  */
> -static void lim_warning (const char *format, ...) ATTRIBUTE_PRINTF (1, 2);
> +static void lim_warning (const char *format, ...) ATTRIBUTE_PRINTF_1;
>  
>  static void
>  lim_warning (const char *format, ...)
> diff --git a/gdb/cli-out.c b/gdb/cli-out.c
> index 4961d8a..9314cad 100644
> --- a/gdb/cli-out.c
> +++ b/gdb/cli-out.c
> @@ -36,7 +36,7 @@ static void field_separator (void);
>  
>  static void out_field_fmt (struct ui_out *uiout, int fldno,
>  			   const char *fldname,
> -			   const char *format,...) ATTRIBUTE_PRINTF (4, 5);
> +			   const char *format,...) ATTRIBUTE_PRINTF_4;
>  
>  /* The destructor.  */
>  
> diff --git a/gdb/common/agent.c b/gdb/common/agent.c
> index 0c3d7a3..2d9ad91 100644
> --- a/gdb/common/agent.c
> +++ b/gdb/common/agent.c
> @@ -28,7 +28,7 @@ int debug_agent = 0;
>  
>  /* A stdarg wrapper for debug_vprintf.  */
>  
> -static void ATTRIBUTE_PRINTF (1, 2)
> +static void ATTRIBUTE_PRINTF_1
>  debug_agent_printf (const char *fmt, ...)
>  {
>    va_list ap;
> diff --git a/gdb/common/buffer.h b/gdb/common/buffer.h
> index 1c748dd..65079e2 100644
> --- a/gdb/common/buffer.h
> +++ b/gdb/common/buffer.h
> @@ -49,7 +49,7 @@ char* buffer_finish (struct buffer *buffer);
>     %x - grow an unsigned integer formatted in hexadecimal in BUFFER.
>     %o - grow an unsigned integer formatted in octal in BUFFER.  */
>  void buffer_xml_printf (struct buffer *buffer, const char *format, ...)
> -  ATTRIBUTE_PRINTF (2, 3);
> +  ATTRIBUTE_PRINTF_2;
>  
>  #define buffer_grow_str(BUFFER,STRING)		\
>    buffer_grow (BUFFER, STRING, strlen (STRING))
> diff --git a/gdb/common/common-debug.h b/gdb/common/common-debug.h
> index 348b0e3..99eb9ee 100644
> --- a/gdb/common/common-debug.h
> +++ b/gdb/common/common-debug.h
> @@ -29,7 +29,7 @@ extern int show_debug_regs;
>     debugging output for the client.  */
>  
>  extern void debug_printf (const char *format, ...)
> -     ATTRIBUTE_PRINTF (1, 2);
> +     ATTRIBUTE_PRINTF_1;
>  
>  /* Print a formatted message to the appropriate channel for
>     debugging output for the client.  This function must be
> diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h
> index 5f750c3..34396e0 100644
> --- a/gdb/common/common-exceptions.h
> +++ b/gdb/common/common-exceptions.h
> @@ -178,8 +178,8 @@ extern void throw_verror (enum errors, const char *fmt, va_list ap)
>  extern void throw_vquit (const char *fmt, va_list ap)
>       ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0);
>  extern void throw_error (enum errors error, const char *fmt, ...)
> -     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 3);
> +     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_2;
>  extern void throw_quit (const char *fmt, ...)
> -     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
> +     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1;
>  
>  #endif /* COMMON_EXCEPTIONS_H */
> diff --git a/gdb/common/common-utils.h b/gdb/common/common-utils.h
> index 67615ba..9df5d38 100644
> --- a/gdb/common/common-utils.h
> +++ b/gdb/common/common-utils.h
> @@ -48,13 +48,13 @@ void xfree (void *);
>  
>  /* Like asprintf and vasprintf, but return the string, throw an error
>     if no memory.  */
> -char *xstrprintf (const char *format, ...) ATTRIBUTE_PRINTF (1, 2);
> +char *xstrprintf (const char *format, ...) ATTRIBUTE_PRINTF_1;
>  char *xstrvprintf (const char *format, va_list ap)
>       ATTRIBUTE_PRINTF (1, 0);
>  
>  /* Like snprintf, but throw an error if the output buffer is too small.  */
>  int xsnprintf (char *str, size_t size, const char *format, ...)
> -     ATTRIBUTE_PRINTF (3, 4);
> +     ATTRIBUTE_PRINTF_3;
>  
>  /* Make a copy of the string at PTR with LEN characters
>     (and add a null character at the end in the copy).
> diff --git a/gdb/common/errors.h b/gdb/common/errors.h
> index 88d77e5..fb3df0b 100644
> --- a/gdb/common/errors.h
> +++ b/gdb/common/errors.h
> @@ -26,7 +26,7 @@
>     provided by the client.  */
>  
>  extern void warning (const char *fmt, ...)
> -     ATTRIBUTE_PRINTF (1, 2);
> +     ATTRIBUTE_PRINTF_1;
>  
>  extern void vwarning (const char *fmt, va_list args)
>       ATTRIBUTE_PRINTF (1, 0);
> @@ -37,7 +37,7 @@ extern void vwarning (const char *fmt, va_list args)
>     return.  The function "verror" must be provided by the client.  */
>  
>  extern void error (const char *fmt, ...)
> -     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
> +     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1;
>  
>  extern void verror (const char *fmt, va_list args)
>       ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0);
> @@ -53,7 +53,7 @@ extern void verror (const char *fmt, va_list args)
>  
>  extern void internal_error (const char *file, int line,
>  			    const char *fmt, ...)
> -     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 4);
> +     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_3;
>  
>  extern void internal_verror (const char *file, int line,
>  			     const char *fmt, va_list args)
> @@ -68,7 +68,7 @@ extern void internal_verror (const char *file, int line,
>  
>  extern void internal_warning (const char *file, int line,
>  			      const char *fmt, ...)
> -     ATTRIBUTE_PRINTF (3, 4);
> +     ATTRIBUTE_PRINTF_3;
>  
>  extern void internal_vwarning (const char *file, int line,
>  			       const char *fmt, va_list args)
> diff --git a/gdb/complaints.h b/gdb/complaints.h
> index a848144..7fc8063 100644
> --- a/gdb/complaints.h
> +++ b/gdb/complaints.h
> @@ -31,11 +31,11 @@ extern struct complaints *symfile_complaints;
>  /* Register a complaint.  */
>  extern void complaint (struct complaints **complaints,
>  		       const char *fmt,
> -		       ...) ATTRIBUTE_PRINTF (2, 3);
> +		       ...) ATTRIBUTE_PRINTF_2;
>  extern void internal_complaint (struct complaints **complaints,
>  				const char *file, int line,
>  				const char *fmt,
> -				...) ATTRIBUTE_PRINTF (4, 5);
> +				...) ATTRIBUTE_PRINTF_4;
>  
>  /* Clear out / initialize all complaint counters that have ever been
>     incremented.  If LESS_VERBOSE is 1, be less verbose about
> diff --git a/gdb/disasm.c b/gdb/disasm.c
> index 52d6a0f..33c6778 100644
> --- a/gdb/disasm.c
> +++ b/gdb/disasm.c
> @@ -363,7 +363,7 @@ do_assembly_only (struct gdbarch *gdbarch, struct ui_out *uiout,
>  /* Initialize the disassemble info struct ready for the specified
>     stream.  */
>  
> -static int ATTRIBUTE_PRINTF (2, 3)
> +static int ATTRIBUTE_PRINTF_2
>  fprintf_disasm (void *stream, const char *format, ...)
>  {
>    va_list args;
> @@ -487,7 +487,7 @@ gdb_insn_length (struct gdbarch *gdbarch, CORE_ADDR addr)
>     nop, we don't want to print anything, we just want to compute the
>     length of the insn.  */
>  
> -static int ATTRIBUTE_PRINTF (2, 3)
> +static int ATTRIBUTE_PRINTF_2
>  gdb_buffered_insn_length_fprintf (void *stream, const char *format, ...)
>  {
>    return 0;
> diff --git a/gdb/exceptions.h b/gdb/exceptions.h
> index f4d62a6..2465771 100644
> --- a/gdb/exceptions.h
> +++ b/gdb/exceptions.h
> @@ -30,7 +30,7 @@ extern const struct gdb_exception exception_none;
>  extern void exception_print (struct ui_file *file, struct gdb_exception e);
>  extern void exception_fprintf (struct ui_file *file, struct gdb_exception e,
>  			       const char *prefix,
> -			       ...) ATTRIBUTE_PRINTF (3, 4);
> +			       ...) ATTRIBUTE_PRINTF_3;
>  
>  /* Call FUNC(UIOUT, FUNC_ARGS) but wrapped within an exception
>     handler.  If an exception (enum return_reason) is thrown using
> diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
> index 0e110e7..113a1ea 100644
> --- a/gdb/gdbserver/ChangeLog
> +++ b/gdb/gdbserver/ChangeLog
> @@ -1,5 +1,10 @@
>  2014-12-01  Cleber Rosa  <cleber@redhat.com>
>  
> +	* ax.c: use shorter versions of function attributes macros.
> +	* tracepoint.c: Likewise.
> +
> +2014-12-01  Cleber Rosa  <cleber@redhat.com>
> +
>          * remote-utils.c: Remove unused variable.
>  
>  2014-11-28  Yao Qi  <yao@codesourcery.com>
> diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c
> index 8b28c72..f5c6179 100644
> --- a/gdb/gdbserver/ax.c
> +++ b/gdb/gdbserver/ax.c
> @@ -22,7 +22,7 @@
>  #include "tracepoint.h"
>  #include "rsp-low.h"
>  
> -static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
> +static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF_1;
>  
>  #ifdef IN_PROCESS_AGENT
>  int debug_agent = 0;
> diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
> index b6ab53f..278fad9 100644
> --- a/gdb/gdbserver/tracepoint.c
> +++ b/gdb/gdbserver/tracepoint.c
> @@ -63,7 +63,7 @@
>  
>  #ifdef IN_PROCESS_AGENT
>  
> -static void trace_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
> +static void trace_vdebug (const char *, ...) ATTRIBUTE_PRINTF_1;
>  
>  static void
>  trace_vdebug (const char *fmt, ...)
> diff --git a/gdb/language.h b/gdb/language.h
> index 73619ca..a4bd02f 100644
> --- a/gdb/language.h
> +++ b/gdb/language.h
> @@ -477,7 +477,7 @@ extern int pointer_type (struct type *);
>  
>  /* Error messages */
>  
> -extern void range_error (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
> +extern void range_error (const char *, ...) ATTRIBUTE_PRINTF_1;
>  
>  /* Data:  Does this value represent "truth" to the current language?  */
>  
> diff --git a/gdb/monitor.c b/gdb/monitor.c
> index d9e7b0a..66e2624 100644
> --- a/gdb/monitor.c
> +++ b/gdb/monitor.c
> @@ -118,7 +118,7 @@ static ptid_t monitor_ptid;
>  /* Monitor specific debugging information.  Typically only useful to
>     the developer of a new monitor interface.  */
>  
> -static void monitor_debug (const char *fmt, ...) ATTRIBUTE_PRINTF (1, 2);
> +static void monitor_debug (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
>  
>  static unsigned int monitor_debug_p = 0;
>  
> diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
> index 2ba6e05..044e534 100644
> --- a/gdb/parser-defs.h
> +++ b/gdb/parser-defs.h
> @@ -382,7 +382,7 @@ extern void print_subexp_standard (struct expression *, int *,
>  /* Function used to avoid direct calls to fprintf
>     in the code generated by the bison parser.  */
>  
> -extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
> +extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF_2;
>  
>  extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile);
>  
> diff --git a/gdb/serial.h b/gdb/serial.h
> index f4ab31e..7b01e96 100644
> --- a/gdb/serial.h
> +++ b/gdb/serial.h
> @@ -112,7 +112,7 @@ extern int serial_write (struct serial *scb, const void *buf, size_t count);
>  /* Write a printf style string onto the serial port.  */
>  
>  extern void serial_printf (struct serial *desc, 
> -			   const char *,...) ATTRIBUTE_PRINTF (2, 3);
> +			   const char *,...) ATTRIBUTE_PRINTF_2;
>  
>  /* Allow pending output to drain.  */
>  
> diff --git a/gdb/ui-out.h b/gdb/ui-out.h
> index cbd0b9b..f566dda 100644
> --- a/gdb/ui-out.h
> +++ b/gdb/ui-out.h
> @@ -114,7 +114,7 @@ extern void ui_out_field_stream (struct ui_out *uiout, const char *fldname,
>  
>  extern void ui_out_field_fmt (struct ui_out *uiout, const char *fldname,
>  			      const char *format, ...)
> -     ATTRIBUTE_PRINTF (3, 4);
> +     ATTRIBUTE_PRINTF_3;
>  
>  extern void ui_out_field_skip (struct ui_out *uiout, const char *fldname);
>  
> @@ -124,7 +124,7 @@ extern void ui_out_text (struct ui_out *uiout, const char *string);
>  
>  extern void ui_out_message (struct ui_out *uiout, int verbosity,
>  			    const char *format, ...)
> -     ATTRIBUTE_PRINTF (3, 4);
> +     ATTRIBUTE_PRINTF_3;
>  
>  extern void ui_out_wrap_hint (struct ui_out *uiout, char *identstring);
>  
> diff --git a/gdb/utils.h b/gdb/utils.h
> index 1568011..175a15e 100644
> --- a/gdb/utils.h
> +++ b/gdb/utils.h
> @@ -145,9 +145,9 @@ char *ldirname (const char *filename);
>  
>  struct ui_file;
>  
> -extern int query (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
> -extern int nquery (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
> -extern int yquery (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
> +extern int query (const char *, ...) ATTRIBUTE_PRINTF_1;
> +extern int nquery (const char *, ...) ATTRIBUTE_PRINTF_1;
> +extern int yquery (const char *, ...) ATTRIBUTE_PRINTF_1;
>  
>  extern void begin_line (void);
>  
> @@ -206,14 +206,14 @@ extern void vfprintf_filtered (struct ui_file *, const char *, va_list)
>    ATTRIBUTE_PRINTF (2, 0);
>  
>  extern void fprintf_filtered (struct ui_file *, const char *, ...)
> -  ATTRIBUTE_PRINTF (2, 3);
> +  ATTRIBUTE_PRINTF_2;
>  
>  extern void fprintfi_filtered (int, struct ui_file *, const char *, ...)
> -  ATTRIBUTE_PRINTF (3, 4);
> +  ATTRIBUTE_PRINTF_3;
>  
> -extern void printf_filtered (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
> +extern void printf_filtered (const char *, ...) ATTRIBUTE_PRINTF_1;
>  
> -extern void printfi_filtered (int, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
> +extern void printfi_filtered (int, const char *, ...) ATTRIBUTE_PRINTF_2;
>  
>  extern void vprintf_unfiltered (const char *, va_list) ATTRIBUTE_PRINTF (1, 0);
>  
> @@ -221,9 +221,9 @@ extern void vfprintf_unfiltered (struct ui_file *, const char *, va_list)
>    ATTRIBUTE_PRINTF (2, 0);
>  
>  extern void fprintf_unfiltered (struct ui_file *, const char *, ...)
> -  ATTRIBUTE_PRINTF (2, 3);
> +  ATTRIBUTE_PRINTF_2;
>  
> -extern void printf_unfiltered (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
> +extern void printf_unfiltered (const char *, ...) ATTRIBUTE_PRINTF_1;
>  
>  extern void print_spaces (int, struct ui_file *);
>  
> @@ -290,7 +290,7 @@ extern void demangler_vwarning (const char *file, int line,
>       ATTRIBUTE_PRINTF (3, 0);
>  
>  extern void demangler_warning (const char *file, int line,
> -			      const char *, ...) ATTRIBUTE_PRINTF (3, 4);
> +		              const char *, ...) ATTRIBUTE_PRINTF_3;
>  
>  \f
>  /* Misc. utilities.  */
> -- 
> 1.9.3

Thanks,

-- 
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] remote-utils.c: remove unused gdb_stdlog
  2014-12-01 20:34 ` [PATCH 1/2] remote-utils.c: remove unused gdb_stdlog Sergio Durigan Junior
@ 2014-12-03 10:12   ` Joel Brobecker
  2014-12-04 16:49     ` Sergio Durigan Junior
  0 siblings, 1 reply; 12+ messages in thread
From: Joel Brobecker @ 2014-12-03 10:12 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: Cleber Rosa, gdb-patches, cleber

> > It looks like this came from an attempt to mimmic gdb/main.c, which
> > has gdb_stdlog, gdb_stderr, gdb_stdout, etc. But in reality, it's
> > not being used on gdbserver.
> 
> Thanks for sending the patch upstream.  As we have already discussed on
> private, this looks almost obvious to me, but let's wait for some
> maintainer to approve.  Meanwhile...

I agree the patch is obvious. But it's a good thing it wasn't pushed
as such, considering the few little tweaks we can apply to make
the submission the best we've had this year :-).

More seriously, the patch is approved after Sergio's comments are
resolved. And also please put the ChangeLog entry also in the revision
log. Going one step further, we now tend to just "git send-email"
the patch using the commit's revision log as the email subject and body.
That way, we have the explanation for the patch in the revision log,
which makes archeology a little easier.

> > Signed-off-by: Cleber Rosa <crosa@redhat.com>
> 
> We don't use Signed-off-by here, but it shouldn't do any harm to keep it
> in the patch.

FWIW, agreed. It's not required, but acceptable as far as I am
concerned (we haven't formally discussed this, but since it seems
harmless to me, I don't see that it could be a problem).

-- 
Joel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] Function attributes: use shorter versions of the format macros
  2014-12-01 15:58 ` [PATCH 2/2] Function attributes: use shorter versions of the format macros Cleber Rosa
  2014-12-01 20:39   ` Sergio Durigan Junior
@ 2014-12-03 10:31   ` Joel Brobecker
  2014-12-04 13:29     ` Cleber Rosa
  2014-12-11 18:51     ` [v2,1/2] remote-utils.c: remove unused gdb_stdlog Cleber Rosa
  1 sibling, 2 replies; 12+ messages in thread
From: Joel Brobecker @ 2014-12-03 10:31 UTC (permalink / raw)
  To: Cleber Rosa; +Cc: gdb-patches, cleber

> For consistency sake, use the shorter versions of the function attribute
> format macros.

Same as in patch #1, please include the ChangeLog entry in the
commit's revision log.

It would be good also to explain in the revision log consistency
with what, becuase GDB uses nearly exclusively the form that you
are removing. I know the answer, now, but it took me some time to
figure it out.

> +2014-12-01  Cleber Rosa  <cleber@redhat.com>
> +
> +	* ada-lang.c: use shorter versions of function attributes macros.
> +	* cli-out.c: Likewise.
> +	* common/agent.c: Likewise.
> +	* common/buffer.h: Likewise.
> +	* common/common-debug.h: Likewise.
> +	* common/common-exceptions.h: Likewise.
> +	* common/common-utils.h: Likewise.
> +	* common/errors.h: Likewise.
> +	* complaints.h: Likewise.
> +	* disasm.c: Likewise.
> +	* exceptions.h: Likewise.
> +	* language.h: Likewise.
> +	* monitor.c: Likewise.
> +	* parser-defs.h: Likewise.
> +	* serial.h: Likewise.
> +	* ui-out.h: Likewise.
> +	* utils.h: Likewise.

Approved.

Thank you,
-- 
Joel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] Function attributes: use shorter versions of the format macros
  2014-12-03 10:31   ` Joel Brobecker
@ 2014-12-04 13:29     ` Cleber Rosa
  2014-12-11 18:51     ` [v2,1/2] remote-utils.c: remove unused gdb_stdlog Cleber Rosa
  1 sibling, 0 replies; 12+ messages in thread
From: Cleber Rosa @ 2014-12-04 13:29 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, cleber

On 12/03/2014 07:31 AM, Joel Brobecker wrote:
>> For consistency sake, use the shorter versions of the function attribute
>> format macros.
> Same as in patch #1, please include the ChangeLog entry in the
> commit's revision log.
>
> It would be good also to explain in the revision log consistency
> with what, becuase GDB uses nearly exclusively the form that you
> are removing. I know the answer, now, but it took me some time to
> figure it out.

Sure!

BTW, thanks for the feedback and help. They are certainly helpful here, 
and will be even more in another upcoming patchset.

>
>> +2014-12-01  Cleber Rosa  <cleber@redhat.com>
>> +
>> +	* ada-lang.c: use shorter versions of function attributes macros.
>> +	* cli-out.c: Likewise.
>> +	* common/agent.c: Likewise.
>> +	* common/buffer.h: Likewise.
>> +	* common/common-debug.h: Likewise.
>> +	* common/common-exceptions.h: Likewise.
>> +	* common/common-utils.h: Likewise.
>> +	* common/errors.h: Likewise.
>> +	* complaints.h: Likewise.
>> +	* disasm.c: Likewise.
>> +	* exceptions.h: Likewise.
>> +	* language.h: Likewise.
>> +	* monitor.c: Likewise.
>> +	* parser-defs.h: Likewise.
>> +	* serial.h: Likewise.
>> +	* ui-out.h: Likewise.
>> +	* utils.h: Likewise.
> Approved.
>
> Thank you,

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] remote-utils.c: remove unused gdb_stdlog
  2014-12-03 10:12   ` Joel Brobecker
@ 2014-12-04 16:49     ` Sergio Durigan Junior
  0 siblings, 0 replies; 12+ messages in thread
From: Sergio Durigan Junior @ 2014-12-04 16:49 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Cleber Rosa, gdb-patches, cleber

On Wednesday, December 03 2014, Joel Brobecker wrote:

> I agree the patch is obvious. But it's a good thing it wasn't pushed
> as such, considering the few little tweaks we can apply to make
> the submission the best we've had this year :-).

:-)

Yeah, in any way I meant that we should go forward without a
maintainer's approval!  Just to be clear :-P.

Anyway, Cleber, I can push both patches to the repo once you fix
everything.

Chers,

-- 
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [v2,1/2] remote-utils.c: remove unused gdb_stdlog
  2014-12-03 10:31   ` Joel Brobecker
  2014-12-04 13:29     ` Cleber Rosa
@ 2014-12-11 18:51     ` Cleber Rosa
  2014-12-11 18:51       ` [v2,2/2] Function attributes: use shorter versions of the format macros Cleber Rosa
  1 sibling, 1 reply; 12+ messages in thread
From: Cleber Rosa @ 2014-12-11 18:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: crosa, sergiodj, lmr, brobecker

It looks like this came from an attempt to mimmic gdb/main.c, which
has gdb_stdlog, gdb_stderr, gdb_stdout, etc. But in reality, it's
not being used on gdbserver.

gdb/gdbserver/ChangeLog:

        * remote-utils.c: Remove unused variable gdb_stdlog
---
 gdb/gdbserver/remote-utils.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 373fc15..442e94e 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -100,7 +100,6 @@ struct sym_cache
 };
 
 int remote_debug = 0;
-struct ui_file *gdb_stdlog;
 
 static int remote_is_stdio = 0;
 
-- 
1.9.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [v2,2/2] Function attributes: use shorter versions of the format macros
  2014-12-11 18:51     ` [v2,1/2] remote-utils.c: remove unused gdb_stdlog Cleber Rosa
@ 2014-12-11 18:51       ` Cleber Rosa
  2014-12-12 11:51         ` Pedro Alves
  0 siblings, 1 reply; 12+ messages in thread
From: Cleber Rosa @ 2014-12-11 18:51 UTC (permalink / raw)
  To: gdb-patches; +Cc: crosa, sergiodj, lmr, brobecker

glibc provides a wide range of function attributes that can help GCC during
code compilation.

One step further, glibc also provides in /usr/include/ansidecl.h a generic
version of a macro called ATTRIBUTE_PRINTF, based on the format function
attribute, and others that are more specific and shorter to write, read and
grasp.

For consistency sake, let's use these shorter versions of those macros.

For more information:
* /usr/include/ansidecl.h
* https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-Wformat-2963

gdb/ChangeLog:

	* ada-lang.c (lim_warning): use shorter versions of function attributes
	macros.
	* cli-out.c (out_field_fmt): Likewise.
	* common/agent.c (debug_agent_printf): Likewise.
	* common/buffer.h (buffer_xml_printf): Likewise.
	* common/common-debug.h (debug_printf): Likewise.
	* common/common-exceptions.h (throw_error): Likewise.
	(throw_quit): Likewise.
	* common/common-utils.h (xstrprintf): Likewise.
	(xsnprintf): Likewise.
	* common/errors.h (warning): Likewise.
	(error): Likewise.
	(internal_error): Likewise.
	(internal_verror): Likewise.
	(internal_warning): Likewise.
	* complaints.h (complaint): Likewise.
	(internal_complaint): Likewise.
	* disasm.c (fprintf_disasm): Likewise.
	(gdb_buffered_insn_length_fprintf): Likewise.
	* exceptions.h (exception_fprintf): Likewise.
	* language.h (range_error): Likewise.
	* monitor.c (monitor_debug): Likewise.
	* parser-defs.h (parser_fprintf): Likewise.
	* serial.h (serial_printf): Likewise.
	* ui-out.h (ui_out_field_fmt): Likewise.
	(ui_out_message): Likewise.
	* utils.h (query): Likewise.
	(nquery): Likewise.
	(yquery): Likewise.
	(fprintf_filtered): Likewise.
	(fprintfi_filtered): Likewise.
	(printf_filtered): Likewise.
	(printfi_filtered): Likewise.
	(fprintf_unfiltered): Likewise.
	(printf_unfiltered): Likewise.
	(demangler_warning): Likewise.

gdb/gdbserver/ChangeLog:

	* ax.c (ax_vdebug): use shorter versions of function attributes
	macros.
	* tracepoint.c (trace_vdebug): Likewise.
---
 gdb/ada-lang.c                 |  2 +-
 gdb/cli-out.c                  |  2 +-
 gdb/common/agent.c             |  2 +-
 gdb/common/buffer.h            |  2 +-
 gdb/common/common-debug.h      |  2 +-
 gdb/common/common-exceptions.h |  4 ++--
 gdb/common/common-utils.h      |  4 ++--
 gdb/common/errors.h            |  8 ++++----
 gdb/complaints.h               |  4 ++--
 gdb/disasm.c                   |  4 ++--
 gdb/exceptions.h               |  2 +-
 gdb/gdbserver/ax.c             |  2 +-
 gdb/gdbserver/tracepoint.c     |  2 +-
 gdb/language.h                 |  2 +-
 gdb/monitor.c                  |  2 +-
 gdb/parser-defs.h              |  2 +-
 gdb/serial.h                   |  2 +-
 gdb/ui-out.h                   |  4 ++--
 gdb/utils.h                    | 20 ++++++++++----------
 19 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 3a024d9..584f1a4 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -721,7 +721,7 @@ cond_offset_target (CORE_ADDR address, long offset)
 
 /* FIXME: cagney/2004-10-10: This function is mimicking the behavior
    provided by "complaint".  */
-static void lim_warning (const char *format, ...) ATTRIBUTE_PRINTF (1, 2);
+static void lim_warning (const char *format, ...) ATTRIBUTE_PRINTF_1;
 
 static void
 lim_warning (const char *format, ...)
diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index 4961d8a..9314cad 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -36,7 +36,7 @@ static void field_separator (void);
 
 static void out_field_fmt (struct ui_out *uiout, int fldno,
 			   const char *fldname,
-			   const char *format,...) ATTRIBUTE_PRINTF (4, 5);
+			   const char *format,...) ATTRIBUTE_PRINTF_4;
 
 /* The destructor.  */
 
diff --git a/gdb/common/agent.c b/gdb/common/agent.c
index 0c3d7a3..2d9ad91 100644
--- a/gdb/common/agent.c
+++ b/gdb/common/agent.c
@@ -28,7 +28,7 @@ int debug_agent = 0;
 
 /* A stdarg wrapper for debug_vprintf.  */
 
-static void ATTRIBUTE_PRINTF (1, 2)
+static void ATTRIBUTE_PRINTF_1
 debug_agent_printf (const char *fmt, ...)
 {
   va_list ap;
diff --git a/gdb/common/buffer.h b/gdb/common/buffer.h
index 1c748dd..65079e2 100644
--- a/gdb/common/buffer.h
+++ b/gdb/common/buffer.h
@@ -49,7 +49,7 @@ char* buffer_finish (struct buffer *buffer);
    %x - grow an unsigned integer formatted in hexadecimal in BUFFER.
    %o - grow an unsigned integer formatted in octal in BUFFER.  */
 void buffer_xml_printf (struct buffer *buffer, const char *format, ...)
-  ATTRIBUTE_PRINTF (2, 3);
+  ATTRIBUTE_PRINTF_2;
 
 #define buffer_grow_str(BUFFER,STRING)		\
   buffer_grow (BUFFER, STRING, strlen (STRING))
diff --git a/gdb/common/common-debug.h b/gdb/common/common-debug.h
index 348b0e3..99eb9ee 100644
--- a/gdb/common/common-debug.h
+++ b/gdb/common/common-debug.h
@@ -29,7 +29,7 @@ extern int show_debug_regs;
    debugging output for the client.  */
 
 extern void debug_printf (const char *format, ...)
-     ATTRIBUTE_PRINTF (1, 2);
+     ATTRIBUTE_PRINTF_1;
 
 /* Print a formatted message to the appropriate channel for
    debugging output for the client.  This function must be
diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h
index 5f750c3..34396e0 100644
--- a/gdb/common/common-exceptions.h
+++ b/gdb/common/common-exceptions.h
@@ -178,8 +178,8 @@ extern void throw_verror (enum errors, const char *fmt, va_list ap)
 extern void throw_vquit (const char *fmt, va_list ap)
      ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0);
 extern void throw_error (enum errors error, const char *fmt, ...)
-     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 3);
+     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_2;
 extern void throw_quit (const char *fmt, ...)
-     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
+     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1;
 
 #endif /* COMMON_EXCEPTIONS_H */
diff --git a/gdb/common/common-utils.h b/gdb/common/common-utils.h
index 67615ba..9df5d38 100644
--- a/gdb/common/common-utils.h
+++ b/gdb/common/common-utils.h
@@ -48,13 +48,13 @@ void xfree (void *);
 
 /* Like asprintf and vasprintf, but return the string, throw an error
    if no memory.  */
-char *xstrprintf (const char *format, ...) ATTRIBUTE_PRINTF (1, 2);
+char *xstrprintf (const char *format, ...) ATTRIBUTE_PRINTF_1;
 char *xstrvprintf (const char *format, va_list ap)
      ATTRIBUTE_PRINTF (1, 0);
 
 /* Like snprintf, but throw an error if the output buffer is too small.  */
 int xsnprintf (char *str, size_t size, const char *format, ...)
-     ATTRIBUTE_PRINTF (3, 4);
+     ATTRIBUTE_PRINTF_3;
 
 /* Make a copy of the string at PTR with LEN characters
    (and add a null character at the end in the copy).
diff --git a/gdb/common/errors.h b/gdb/common/errors.h
index 88d77e5..fb3df0b 100644
--- a/gdb/common/errors.h
+++ b/gdb/common/errors.h
@@ -26,7 +26,7 @@
    provided by the client.  */
 
 extern void warning (const char *fmt, ...)
-     ATTRIBUTE_PRINTF (1, 2);
+     ATTRIBUTE_PRINTF_1;
 
 extern void vwarning (const char *fmt, va_list args)
      ATTRIBUTE_PRINTF (1, 0);
@@ -37,7 +37,7 @@ extern void vwarning (const char *fmt, va_list args)
    return.  The function "verror" must be provided by the client.  */
 
 extern void error (const char *fmt, ...)
-     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
+     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1;
 
 extern void verror (const char *fmt, va_list args)
      ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0);
@@ -53,7 +53,7 @@ extern void verror (const char *fmt, va_list args)
 
 extern void internal_error (const char *file, int line,
 			    const char *fmt, ...)
-     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 4);
+     ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_3;
 
 extern void internal_verror (const char *file, int line,
 			     const char *fmt, va_list args)
@@ -68,7 +68,7 @@ extern void internal_verror (const char *file, int line,
 
 extern void internal_warning (const char *file, int line,
 			      const char *fmt, ...)
-     ATTRIBUTE_PRINTF (3, 4);
+     ATTRIBUTE_PRINTF_3;
 
 extern void internal_vwarning (const char *file, int line,
 			       const char *fmt, va_list args)
diff --git a/gdb/complaints.h b/gdb/complaints.h
index a848144..7fc8063 100644
--- a/gdb/complaints.h
+++ b/gdb/complaints.h
@@ -31,11 +31,11 @@ extern struct complaints *symfile_complaints;
 /* Register a complaint.  */
 extern void complaint (struct complaints **complaints,
 		       const char *fmt,
-		       ...) ATTRIBUTE_PRINTF (2, 3);
+		       ...) ATTRIBUTE_PRINTF_2;
 extern void internal_complaint (struct complaints **complaints,
 				const char *file, int line,
 				const char *fmt,
-				...) ATTRIBUTE_PRINTF (4, 5);
+				...) ATTRIBUTE_PRINTF_4;
 
 /* Clear out / initialize all complaint counters that have ever been
    incremented.  If LESS_VERBOSE is 1, be less verbose about
diff --git a/gdb/disasm.c b/gdb/disasm.c
index 52d6a0f..33c6778 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -363,7 +363,7 @@ do_assembly_only (struct gdbarch *gdbarch, struct ui_out *uiout,
 /* Initialize the disassemble info struct ready for the specified
    stream.  */
 
-static int ATTRIBUTE_PRINTF (2, 3)
+static int ATTRIBUTE_PRINTF_2
 fprintf_disasm (void *stream, const char *format, ...)
 {
   va_list args;
@@ -487,7 +487,7 @@ gdb_insn_length (struct gdbarch *gdbarch, CORE_ADDR addr)
    nop, we don't want to print anything, we just want to compute the
    length of the insn.  */
 
-static int ATTRIBUTE_PRINTF (2, 3)
+static int ATTRIBUTE_PRINTF_2
 gdb_buffered_insn_length_fprintf (void *stream, const char *format, ...)
 {
   return 0;
diff --git a/gdb/exceptions.h b/gdb/exceptions.h
index f4d62a6..2465771 100644
--- a/gdb/exceptions.h
+++ b/gdb/exceptions.h
@@ -30,7 +30,7 @@ extern const struct gdb_exception exception_none;
 extern void exception_print (struct ui_file *file, struct gdb_exception e);
 extern void exception_fprintf (struct ui_file *file, struct gdb_exception e,
 			       const char *prefix,
-			       ...) ATTRIBUTE_PRINTF (3, 4);
+			       ...) ATTRIBUTE_PRINTF_3;
 
 /* Call FUNC(UIOUT, FUNC_ARGS) but wrapped within an exception
    handler.  If an exception (enum return_reason) is thrown using
diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c
index 8b28c72..f5c6179 100644
--- a/gdb/gdbserver/ax.c
+++ b/gdb/gdbserver/ax.c
@@ -22,7 +22,7 @@
 #include "tracepoint.h"
 #include "rsp-low.h"
 
-static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF_1;
 
 #ifdef IN_PROCESS_AGENT
 int debug_agent = 0;
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index b6ab53f..278fad9 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -63,7 +63,7 @@
 
 #ifdef IN_PROCESS_AGENT
 
-static void trace_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+static void trace_vdebug (const char *, ...) ATTRIBUTE_PRINTF_1;
 
 static void
 trace_vdebug (const char *fmt, ...)
diff --git a/gdb/language.h b/gdb/language.h
index 73619ca..a4bd02f 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -477,7 +477,7 @@ extern int pointer_type (struct type *);
 
 /* Error messages */
 
-extern void range_error (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+extern void range_error (const char *, ...) ATTRIBUTE_PRINTF_1;
 
 /* Data:  Does this value represent "truth" to the current language?  */
 
diff --git a/gdb/monitor.c b/gdb/monitor.c
index d9e7b0a..66e2624 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -118,7 +118,7 @@ static ptid_t monitor_ptid;
 /* Monitor specific debugging information.  Typically only useful to
    the developer of a new monitor interface.  */
 
-static void monitor_debug (const char *fmt, ...) ATTRIBUTE_PRINTF (1, 2);
+static void monitor_debug (const char *fmt, ...) ATTRIBUTE_PRINTF_1;
 
 static unsigned int monitor_debug_p = 0;
 
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index 2ba6e05..044e534 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -382,7 +382,7 @@ extern void print_subexp_standard (struct expression *, int *,
 /* Function used to avoid direct calls to fprintf
    in the code generated by the bison parser.  */
 
-extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
+extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF_2;
 
 extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile);
 
diff --git a/gdb/serial.h b/gdb/serial.h
index f4ab31e..7b01e96 100644
--- a/gdb/serial.h
+++ b/gdb/serial.h
@@ -112,7 +112,7 @@ extern int serial_write (struct serial *scb, const void *buf, size_t count);
 /* Write a printf style string onto the serial port.  */
 
 extern void serial_printf (struct serial *desc, 
-			   const char *,...) ATTRIBUTE_PRINTF (2, 3);
+			   const char *,...) ATTRIBUTE_PRINTF_2;
 
 /* Allow pending output to drain.  */
 
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index cbd0b9b..f566dda 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -114,7 +114,7 @@ extern void ui_out_field_stream (struct ui_out *uiout, const char *fldname,
 
 extern void ui_out_field_fmt (struct ui_out *uiout, const char *fldname,
 			      const char *format, ...)
-     ATTRIBUTE_PRINTF (3, 4);
+     ATTRIBUTE_PRINTF_3;
 
 extern void ui_out_field_skip (struct ui_out *uiout, const char *fldname);
 
@@ -124,7 +124,7 @@ extern void ui_out_text (struct ui_out *uiout, const char *string);
 
 extern void ui_out_message (struct ui_out *uiout, int verbosity,
 			    const char *format, ...)
-     ATTRIBUTE_PRINTF (3, 4);
+     ATTRIBUTE_PRINTF_3;
 
 extern void ui_out_wrap_hint (struct ui_out *uiout, char *identstring);
 
diff --git a/gdb/utils.h b/gdb/utils.h
index 660b548..7293c47 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -145,9 +145,9 @@ char *ldirname (const char *filename);
 
 struct ui_file;
 
-extern int query (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
-extern int nquery (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
-extern int yquery (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+extern int query (const char *, ...) ATTRIBUTE_PRINTF_1;
+extern int nquery (const char *, ...) ATTRIBUTE_PRINTF_1;
+extern int yquery (const char *, ...) ATTRIBUTE_PRINTF_1;
 
 extern void begin_line (void);
 
@@ -206,14 +206,14 @@ extern void vfprintf_filtered (struct ui_file *, const char *, va_list)
   ATTRIBUTE_PRINTF (2, 0);
 
 extern void fprintf_filtered (struct ui_file *, const char *, ...)
-  ATTRIBUTE_PRINTF (2, 3);
+  ATTRIBUTE_PRINTF_2;
 
 extern void fprintfi_filtered (int, struct ui_file *, const char *, ...)
-  ATTRIBUTE_PRINTF (3, 4);
+  ATTRIBUTE_PRINTF_3;
 
-extern void printf_filtered (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+extern void printf_filtered (const char *, ...) ATTRIBUTE_PRINTF_1;
 
-extern void printfi_filtered (int, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
+extern void printfi_filtered (int, const char *, ...) ATTRIBUTE_PRINTF_2;
 
 extern void vprintf_unfiltered (const char *, va_list) ATTRIBUTE_PRINTF (1, 0);
 
@@ -221,9 +221,9 @@ extern void vfprintf_unfiltered (struct ui_file *, const char *, va_list)
   ATTRIBUTE_PRINTF (2, 0);
 
 extern void fprintf_unfiltered (struct ui_file *, const char *, ...)
-  ATTRIBUTE_PRINTF (2, 3);
+  ATTRIBUTE_PRINTF_2;
 
-extern void printf_unfiltered (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
+extern void printf_unfiltered (const char *, ...) ATTRIBUTE_PRINTF_1;
 
 extern void print_spaces (int, struct ui_file *);
 
@@ -290,7 +290,7 @@ extern void demangler_vwarning (const char *file, int line,
      ATTRIBUTE_PRINTF (3, 0);
 
 extern void demangler_warning (const char *file, int line,
-			      const char *, ...) ATTRIBUTE_PRINTF (3, 4);
+		              const char *, ...) ATTRIBUTE_PRINTF_3;
 
 \f
 /* Misc. utilities.  */
-- 
1.9.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [v2,2/2] Function attributes: use shorter versions of the format macros
  2014-12-11 18:51       ` [v2,2/2] Function attributes: use shorter versions of the format macros Cleber Rosa
@ 2014-12-12 11:51         ` Pedro Alves
  2014-12-13 16:21           ` Cleber Rosa
  0 siblings, 1 reply; 12+ messages in thread
From: Pedro Alves @ 2014-12-12 11:51 UTC (permalink / raw)
  To: Cleber Rosa, gdb-patches; +Cc: sergiodj, lmr, brobecker

On 12/11/2014 06:50 PM, Cleber Rosa wrote:
> glibc provides a wide range of function attributes that can help GCC during
> code compilation.
> 
> One step further, glibc also provides in /usr/include/ansidecl.h a generic
> version of a macro called ATTRIBUTE_PRINTF, based on the format function
> attribute, and others that are more specific and shorter to write, read and
> grasp.

We have an ansidecl.h in gdb/../include/
that still says it's part of glibc, but the glibc copy AFAIK is long
gone.  Seems to have been removed in 1997:

    1997-06-13 10:06  Richard Henderson  <rth@tamu.edu>
...
        * ansidecl.h: Removed.

I don't have a /usr/include/ansidecl.h in my F20 system, nor do I see
any ansidecl.h in the glibc sources.

I'd guess your /usr/include/ansidecl.h file is really our/gcc's file,
not glibc's.

> 
> For consistency sake, let's use these shorter versions of those macros.

Consistency with?  You mean, consistency throughout?

> 
> For more information:
> * /usr/include/ansidecl.h
> * https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-Wformat-2963
> 
> gdb/ChangeLog:
> 
> 	* ada-lang.c (lim_warning): use shorter versions of function attributes
> 	macros.

Uppercase "use".

> gdb/gdbserver/ChangeLog:
> 
> 	* ax.c (ax_vdebug): use shorter versions of function attributes
> 	macros.

Likewise.

The patch itself looks fine to me (too).

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [v2,2/2] Function attributes: use shorter versions of the format macros
  2014-12-12 11:51         ` Pedro Alves
@ 2014-12-13 16:21           ` Cleber Rosa
  0 siblings, 0 replies; 12+ messages in thread
From: Cleber Rosa @ 2014-12-13 16:21 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, sergiodj, lmr, brobecker



----- Original Message -----
> From: "Pedro Alves" <palves@redhat.com>
> To: "Cleber Rosa" <crosa@redhat.com>, gdb-patches@sourceware.org
> Cc: sergiodj@redhat.com, lmr@redhat.com, brobecker@adacore.com
> Sent: Friday, December 12, 2014 8:51:35 AM
> Subject: Re: [v2,2/2] Function attributes: use shorter versions of the format macros
> 
> On 12/11/2014 06:50 PM, Cleber Rosa wrote:
> > glibc provides a wide range of function attributes that can help GCC during
> > code compilation.
> > 
> > One step further, glibc also provides in /usr/include/ansidecl.h a generic
> > version of a macro called ATTRIBUTE_PRINTF, based on the format function
> > attribute, and others that are more specific and shorter to write, read and
> > grasp.
> 
> We have an ansidecl.h in gdb/../include/
> that still says it's part of glibc, but the glibc copy AFAIK is long
> gone.  Seems to have been removed in 1997:
> 
>     1997-06-13 10:06  Richard Henderson  <rth@tamu.edu>
> ...
>         * ansidecl.h: Removed.
> 
> I don't have a /usr/include/ansidecl.h in my F20 system, nor do I see
> any ansidecl.h in the glibc sources.
> 
> I'd guess your /usr/include/ansidecl.h file is really our/gcc's file,
> not glibc's.

I do have /usr/include/ansidecl.h on my F20 box, but you're right, it's not a part of glibc but part of binutils(-devel).

> 
> > 
> > For consistency sake, let's use these shorter versions of those macros.
> 
> Consistency with?  You mean, consistency throughout?

Throughout the whole repo (git://sourceware.org/git/binutils-gdb.git). The ATTRIBUTE_PRINTF_* is found on binutils/*, gold/*, libiberty/*, etc.

> 
> > 
> > For more information:
> > * /usr/include/ansidecl.h
> > *
> > https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-Wformat-2963
> > 
> > gdb/ChangeLog:
> > 
> > 	* ada-lang.c (lim_warning): use shorter versions of function attributes
> > 	macros.
> 
> Uppercase "use".

OK!

> 
> > gdb/gdbserver/ChangeLog:
> > 
> > 	* ax.c (ax_vdebug): use shorter versions of function attributes
> > 	macros.
> 
> Likewise.
> 
> The patch itself looks fine to me (too).

Will send a v3, thanks!

> 
> Thanks,
> Pedro Alves
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-12-13 16:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-01 15:58 [PATCH 1/2] remote-utils.c: remove unused gdb_stdlog Cleber Rosa
2014-12-01 15:58 ` [PATCH 2/2] Function attributes: use shorter versions of the format macros Cleber Rosa
2014-12-01 20:39   ` Sergio Durigan Junior
2014-12-03 10:31   ` Joel Brobecker
2014-12-04 13:29     ` Cleber Rosa
2014-12-11 18:51     ` [v2,1/2] remote-utils.c: remove unused gdb_stdlog Cleber Rosa
2014-12-11 18:51       ` [v2,2/2] Function attributes: use shorter versions of the format macros Cleber Rosa
2014-12-12 11:51         ` Pedro Alves
2014-12-13 16:21           ` Cleber Rosa
2014-12-01 20:34 ` [PATCH 1/2] remote-utils.c: remove unused gdb_stdlog Sergio Durigan Junior
2014-12-03 10:12   ` Joel Brobecker
2014-12-04 16:49     ` Sergio Durigan Junior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).