bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1] xstrtol: 1 is not a valid base


From: Bruno Haible
Subject: Re: [PATCH v1] xstrtol: 1 is not a valid base
Date: Fri, 19 Jul 2024 18:45:49 +0200

Paul Eggert wrote:
> I installed the attached Gnulib patch which addresses that 
> point ...

The comments reference parameter names VAL, VALID_SUFFIXES, etc.
but the declaration does not contain parameter names. This patch
fixes that:


2024-07-19  Bruno Haible  <bruno@clisp.org>

        xstrtol: Improve documentation.
        * lib/xstrtol.h: Don't test _STRTOL_ERROR, left-over from 2007-08-08.
        (_DECLARE_XSTRTOL): Add the parameter names, referenced by the comments.

diff --git a/lib/xstrtol.h b/lib/xstrtol.h
index cedff6393e..10b48cac4e 100644
--- a/lib/xstrtol.h
+++ b/lib/xstrtol.h
@@ -27,7 +27,6 @@ extern "C" {
 #endif
 
 
-#ifndef _STRTOL_ERROR
 enum strtol_error
   {
     LONGINT_OK = 0,
@@ -42,7 +41,6 @@ enum strtol_error
     LONGINT_INVALID = 4
   };
 typedef enum strtol_error strtol_error;
-#endif
 
 /* Act like the system's strtol (NPTR, ENDPTR, BASE) except:
    - The TYPE of the result might be something other than long int.
@@ -59,8 +57,11 @@ typedef enum strtol_error strtol_error;
      'c' for 1, and 'w' for 2.  */
 
 #define _DECLARE_XSTRTOL(name, type) \
-  strtol_error name (char const *restrict, char **restrict, int, \
-                     type *restrict, char const *restrict);
+  strtol_error name (char const *restrict /*nptr*/,             \
+                     char **restrict /*endptr*/,                \
+                     int /*base*/,                              \
+                     type *restrict /*val*/,                    \
+                     char const *restrict /*valid_suffixes*/);
 _DECLARE_XSTRTOL (xstrtol, long int)
 _DECLARE_XSTRTOL (xstrtoul, unsigned long int)
 _DECLARE_XSTRTOL (xstrtoll, long long int)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]