[PATCH] manual: Fixed typo in manual/stdio.texi [BZ #24638]

Girish Joshi girish946@gmail.com
Mon Mar 9 12:22:36 GMT 2020


Thanks Florian,

>> Do you want to fix the other issue as well?  The missing declaration of
>> the variable i, and the incorrect argument list for the error function?

Following is the patch for this.

>From c6035dc2cadee6088a8697b4263657dc350d4e36 Mon Sep 17 00:00:00 2001
From: Girish Joshi <girish946@gmail.com>
Date: Mon, 9 Mar 2020 17:04:27 +0530
Subject: [PATCH] manual: Fix example for parse_printf_format in stdio.texi.

Added the missing declaration of variable i and argument list
for error () function corrected.
---
 manual/stdio.texi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/manual/stdio.texi b/manual/stdio.texi
index c48e3e692f..7d0e51c504 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -2885,12 +2885,13 @@ validate_args (char *format, int nargs, OBJECT *args)
   /* @r{Check the number of arguments.}  */
   if (nwanted > nargs)
     @{
-      error ("too few arguments (at least %d required)", nwanted);
+      error (0, 0, "too few arguments (at least %d required)", nwanted);
       return 0;
     @}

   /* @r{Check the C type wanted for each argument}
      @r{and see if the object given is suitable.}  */
+  int i;
   for (i = 0; i < nwanted; i++)
     @{
       int wanted;
@@ -2917,7 +2918,7 @@ validate_args (char *format, int nargs, OBJECT *args)
       @}
       if (TYPE (args[i]) != wanted)
     @{
-      error ("type mismatch for arg number %d", i);
+      error (0, 0, "type mismatch for arg number %d", i);
       return 0;
     @}
     @}
-- 
2.21.1

> I would suggest to try to get the example to compile.  You will have to
> supply a fake OBJECT type and the other stubbed-out things, but after
> that, some compilation errors remain, and we should fix those.

I'm trying to do that. Still figuring out the right way to implement the
TYPE () function/macro.

Girish Joshi


More information about the Libc-alpha mailing list