Thread: PgSQL 8.0.0 beta1 compile problem + patch

PgSQL 8.0.0 beta1 compile problem + patch

From
Nikola Milutinovic
Date:
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);

Re: PgSQL 8.0.0 beta1 compile problem + patch

From
Bruce Momjian
Date:
Yea, we just fixed that.  Thanks.

---------------------------------------------------------------------------

Nikola Milutinovic wrote:
> 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);

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073