Message ID | CALkY8p8-MKPYh+z5XLOrfXdh5rr7U=tahEMO5Qp1vT0_=_G3Pw@mail.gmail.com |
---|---|
State | Committed |
Headers |
Received: (qmail 103376 invoked by alias); 2 Mar 2020 18:57:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 103353 invoked by uid 89); 2 Mar 2020 18:57:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-wr1-f50.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=wb2r0GF3brTlDJq8Fl3OGyjv9mmUbyuzwSBQQ0iCHtw=; b=V9cQ+s4Irzzt6KvDtC2rVcYzh5UfJ6kVkhNT8Eswzg9GGPIxBL1Xc45bCKfNfws/2b O1kkTAKme8bT8dU46FRgCSv9cCPKdjKIzKgHrBOC35qUVCCjNe7PXiCWPbVR7DS1iZo9 KSZlaSwkm3MrC20BI/p2mKS8lSsSjdOMuNIBbvH2lt+JRSawWzZATmggXOzq44b9jHp+ 6nnT/rpGv+uO0NDH/Qqa2r5/oy3FBu5YG5BbJFw17PhiBqIcZrVuwyx4dt7vMHxzFX8d afqgWi6l8NXKZ61y05wqzPcHvmMcoAk2EIaDElVtfL84yn/ida+Gn3YHg7NmCKtCvkuj n36g== MIME-Version: 1.0 From: Girish Joshi <girish946@gmail.com> Date: Tue, 3 Mar 2020 00:27:25 +0530 Message-ID: <CALkY8p8-MKPYh+z5XLOrfXdh5rr7U=tahEMO5Qp1vT0_=_G3Pw@mail.gmail.com> Subject: [PATCH] manual: Fixed typo in manual/stdio.texi [BZ #24638] To: libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" |
Commit Message
Girish Joshi
March 2, 2020, 6:57 p.m. UTC
From 7f69eae716feb76474975fbf23d48e975019a424 Mon Sep 17 00:00:00 2001
From: Girish Joshi <girish946@gmail.com>
Date: Tue, 3 Mar 2020 00:24:28 +0530
Subject: [PATCH] [PATCH] Fixed typo in the example for parse_printf_format()
in manual/stdio.texi [BZ #24638]
---
manual/stdio.texi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
* Girish Joshi: > From 7f69eae716feb76474975fbf23d48e975019a424 Mon Sep 17 00:00:00 2001 > From: Girish Joshi <girish946@gmail.com> > Date: Tue, 3 Mar 2020 00:24:28 +0530 > Subject: [PATCH] [PATCH] Fixed typo in the example for parse_printf_format() > in manual/stdio.texi [BZ #24638] > > --- > manual/stdio.texi | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/manual/stdio.texi b/manual/stdio.texi > index 8051603321..c48e3e692f 100644 > --- a/manual/stdio.texi > +++ b/manual/stdio.texi > @@ -2880,7 +2880,7 @@ validate_args (char *format, int nargs, OBJECT *args) > @r{length of the string.} */ > > argtypes = (int *) alloca (strlen (format) / 2 * sizeof (int)); > - nwanted = parse_printf_format (string, nelts, argtypes); > + nwanted = parse_printf_format (format, nargs, argtypes); > > /* @r{Check the number of arguments.} */ > if (nwanted > nargs) Thanks. I've shortened the commit message a bit and pushed this for you. 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? Florian
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? Sure. I'll be happy to do that. Could you please provide some pointers? Girish Joshi.
* Girish Joshi: > 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? > > Sure. I'll be happy to do that. > Could you please provide some pointers? 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. Thanks, Florian
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; @} @}
* Girish Joshi: > /* @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++) Please move the declaration of i into the for statement or to the start of the function.
On Mon, Mar 9, 2020 at 5:58 PM Florian Weimer <fw@deneb.enyo.de> wrote: > > * Girish Joshi: > > > /* @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++) > > Please move the declaration of i into the for statement or to the > start of the function. My bad. Corrected that. >From b1b57db94504879d5249bace204a03917869b50e 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..ada425c3c1 100644 --- a/manual/stdio.texi +++ b/manual/stdio.texi @@ -2873,6 +2873,7 @@ validate_args (char *format, int nargs, OBJECT *args) @{ int *argtypes; int nwanted; + int i; /* @r{Get the information about the arguments.} @r{Each conversion specification must be at least two characters} @@ -2885,7 +2886,7 @@ 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; @} @@ -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; @} @}
diff --git a/manual/stdio.texi b/manual/stdio.texi index 8051603321..c48e3e692f 100644 --- a/manual/stdio.texi +++ b/manual/stdio.texi @@ -2880,7 +2880,7 @@ validate_args (char *format, int nargs, OBJECT *args) @r{length of the string.} */ argtypes = (int *) alloca (strlen (format) / 2 * sizeof (int)); - nwanted = parse_printf_format (string, nelts, argtypes); + nwanted = parse_printf_format (format, nargs, argtypes); /* @r{Check the number of arguments.} */ if (nwanted > nargs)