bug-coreutils
[Top][All Lists]
Advanced

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

Re: 'expr' problems with strcoll and POSIX (coreutils 5.0.1)


From: Paul Eggert
Subject: Re: 'expr' problems with strcoll and POSIX (coreutils 5.0.1)
Date: 22 Jul 2003 15:10:09 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Jim Meyering <address@hidden> writes:

> I suspect you did not mean to reintroduce those anachronistic casts.

Yes, it wasn't intentional; I was just syncing.

I just noticed that some parentheses are missing in CCLONE, and there
are some redundant parentheses in that and other macros.  I'll sync
coreutils into gnulib after applying the following patch to the
coreutils version.  (The long list of copyright years is for
conformance to the copyright advice in the gnu maintainer's manual.)

2003-07-22  Paul Eggert  <address@hidden>

        * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
        over-parenthesization in macros.

--- coreutils/lib/xalloc.h      Fri Jul 18 00:02:34 2003
+++ gnulib-exit_failure/lib/xalloc.h    Tue Jul 22 14:55:52 2003
@@ -1,6 +1,7 @@
 /* xalloc.h -- malloc with out-of-memory checking
 
-   Copyright (C) 1990-2000, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+   1999, 2000, 2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -53,9 +54,8 @@ void *xrealloc (void *p, size_t n);
 char *xstrdup (const char *str);
 
 # define XMALLOC(Type, N_items) xmalloc (sizeof (Type) * (N_items))
-# define XCALLOC(Type, N_items) xcalloc (sizeof (Type), (N_items))
-# define XREALLOC(Ptr, Type, N_items) xrealloc ((Ptr), \
-                                               sizeof (Type) * (N_items))
+# define XCALLOC(Type, N_items) xcalloc (sizeof (Type), N_items)
+# define XREALLOC(Ptr, Type, N_items) xrealloc (Ptr, sizeof (Type) * (N_items))
 
 /* Declare and alloc memory for VAR of type TYPE. */
 # define NEW(Type, Var)  Type *(Var) = XMALLOC (Type, 1)
@@ -69,7 +69,7 @@ char *xstrdup (const char *str);
 
 /* Return a pointer to a malloc'ed copy of the array SRC of NUM elements. */
 # define CCLONE(Src, Num) \
-  (memcpy (xmalloc (sizeof (*Src) * (Num)), (Src), sizeof (*Src) * (Num)))
+  (memcpy (xmalloc (sizeof *(Src) * (Num)), Src, sizeof *(Src) * (Num)))
 
 /* Return a malloc'ed copy of SRC. */
 # define CLONE(Src) CCLONE (Src, 1)




reply via email to

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