PgSQL 8.0.0 beta1 compile problem + patch - Mailing list pgsql-general

From Nikola Milutinovic
Subject PgSQL 8.0.0 beta1 compile problem + patch
Date
Msg-id 411B4E48.2000703@ev.co.yu
Whole thread Raw
Responses Re: PgSQL 8.0.0 beta1 compile problem + patch
List pgsql-general
Hi all.

Ran into a minor showstopper. Sometimes, my CC is just too much of a
nitpick, but on this matter, I agree with it. "./src/timezone/zic.c" has
a mismatch in declaration and definition of "memcheck(...)" function. My
CC beltched on it (I was running it in strict ANSI mode). The diference
is this:

static char *memcheck(char *tocheck);
...
/*
  * Memory allocation.
  */

static char *
memcheck(ptr)
char       *const ptr;
{
         if (ptr == NULL)
         {
                 const char *e = strerror(errno);

                 (void) fprintf(stderr, _("%s: Memory exhausted: %s\n"),
                                            progname, e);
                 (void) exit(EXIT_FAILURE);
         }
         return ptr;
}

Notice "char *const ptr". Trusting that the lower definition is correct,
being more strict and closer to the actual code, I have changed the uper
declaration to match. I have attached a patch.

Nix.
*** src/timezone/zic.c.orig    Thu Aug 12 12:44:44 2004
--- src/timezone/zic.c    Thu Aug 12 12:45:05 2004
***************
*** 134,140 ****
  static int    itsabbr(const char *abbr, const char *word);
  static int    itsdir(const char *name);
  static int    lowerit(int c);
! static char *memcheck(char *tocheck);
  static int    mkdirs(char *filename);
  static void newabbr(const char *abbr);
  static long oadd(long t1, long t2);
--- 134,140 ----
  static int    itsabbr(const char *abbr, const char *word);
  static int    itsdir(const char *name);
  static int    lowerit(int c);
! static char *memcheck(char *const tocheck);
  static int    mkdirs(char *filename);
  static void newabbr(const char *abbr);
  static long oadd(long t1, long t2);

pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Replication options?
Next
From: Raphael Bauduin
Date:
Subject: Re: history tables with only one function?