Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#56 utility.c:3886: `message_p' undeclared (first use in this fu

Algorithms (87)

This was on FreeBSD 4.11, during a portupgrade to 1.1.7 of GraphicsMagick the following stop occurred when compiling utility.c:

(WAS not sure if it was a core or delegate (no idea what a delegate is)

The error:-

** Fix the problem and try again.
** Listing the failed packages (*:skipped / !:failed)
! graphics/GraphicsMagick (GraphicsMagick-1.1.6_3) (compiler error)
---> Packages processed: 0 done, 0 ignored, 0 skipped and 1 failed
-su-2.05b# cd /usr/ports/graphics/GraphicsMagick
-su-2.05b# make
===> Building for GraphicsMagick-1.1.7
Making all in ltdl
Making all in config
Making all in coders
Making all in filters
Making all in magick
make all-am
source='utility.c' object='utility.lo' libtool=yes DEPDIR=.deps depmode=gcc /bin/sh ../depcomp /bin/sh ../libtool --silent --mode=compile cc -DHAVE_CONFIG_H -I../ -I. -I. -I. -I. -I.. -I.. -I../ltdl -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/local/include/libxml2 -O -pipe -march=pentiumpro -Wall -c -o utility.lo utility.c
utility.c: In function `GmSystemCommand':
utility.c:3885: syntax error before `const'
utility.c:3886: `message_p' undeclared (first use in this function)
utility.c:3886: (Each undeclared identifier is reported only once
utility.c:3886: for each function it appears in.)
*** Error code 1

Stop in /usr/ports/graphics/GraphicsMagick/work/GraphicsMagick-1.1.7/magick.
*** Error code 1

Stop in /usr/ports/graphics/GraphicsMagick/work/GraphicsMagick-1.1.7/magick.
*** Error code 1

Stop in /usr/ports/graphics/GraphicsMagick/work/GraphicsMagick-1.1.7.
*** Error code 1

Stop in /usr/ports/graphics/GraphicsMagick.

I figured I can fix this:-) cos it looked simple, and it was... phew:-)

I just moved the declaration above the if bit.

Here is the diff o/p.

> const char
> *message_p = (const char *) NULL;
< const char
< *message_p = (const char *) NULL;


  • Logged In: YES
    Originator: NO

    I am confused because in GraphicsMagick 1.1.7 the declaration of message_p *is* above the "if bit".
    What am I missing? Is it possible that you are using patched code (maybe automatically applied)?

    const char
    *message_p = (const char *) NULL;

    #if defined(POSIX)
    if (status == 1)

  • inventHP

    Logged In: YES
    Originator: YES


    You are right. Sorry about this, I don't get to play with c code much these days so I felt kinda of chuffed.

    I think I need to contact the port maintainer.

    cd /usr/ports/graphics/GraphicsMagick/
    -su-2.05b# ls -l
    total 24
    -rw-r--r-- 1 root wheel 2340 Nov 30 11:29 Makefile
    -rw-r--r-- 1 root wheel 221 Nov 30 11:29 distinfo
    drwxr-xr-x 2 root wheel 512 Nov 30 11:29 files
    -rw-r--r-- 1 root wheel 474 Jul 27 2005 pkg-descr
    -rw-r--r-- 1 root wheel 10674 Feb 24 2006 pkg-plist
    drwxr-xr-x 3 root wheel 512 Dec 5 20:14 work
    -su-2.05b# ls -l files
    total 10
    -rw-r--r-- 1 root wheel 3373 Jul 27 2005
    -rw-r--r-- 1 root wheel 1099 Aug 21 11:34 patch-coders-png.c
    -rw-r--r-- 1 root wheel 1233 Jul 27 2005 patch-configure
    -rw-r--r-- 1 root wheel 541 Jul 27 2005 patch-utility
    -su-2.05b# cat files/patch-utility
    --- magick/utility.c Sat Apr 2 17:35:06 2005
    +++ magick/utility.c Sun Jul 24 18:22:40 2005
    @@ -47,4 +47,8 @@
    #include "magick/utility.h"

    +#if defined(POSIX)
    +# include <sys/types.h>
    +# include <sys/wait.h>

    @@ -3874,4 +3878,9 @@
    #if defined(POSIX)
    + if (status == -1)
    + perror(command);
    + else if (WIFSIGNALED(status)) {
    + fprintf(stderr, "Command ``\n%s\n'' terminated due to signal %d\n", command, WTERMSIG(status));
    + }
    #elif defined(vms)

    • status: open --> closed-rejected
  • Logged In: YES
    Originator: NO

    I believe that you are the victim of a bad ports-system patch. The problem is not in
    GraphicsMagick itself. So I am rejecting this bug report.