Subject: pkg/32895: print/ja-vflib-lib problem with gcc-4.0
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <makoto@ki.nu>
List: pkgsrc-bugs
Date: 02/22/2006 00:55:00
>Number:         32895
>Category:       pkg
>Synopsis:       static declaration of 'ReturnCache' follows non-static declaration
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 22 00:55:00 +0000 2006
>Originator:     Makoto Fujiwara
>Release:        Mac OS X 10.4.5
>Organization:
KINU Corporation
Makoto Fujiwara
makoto@ki.nu
>Environment:
	
	
Darwin harry.ki.nu 8.5.0 Darwin Kernel Version 8.5.0: Sun Jan 22 10:38:46 PST 2006; root:xnu-792.6.61.obj~1/RELEASE_PPC Power Macintosh powerpc
Architecture: powerpc
Machine: darwin
>Description:
In the file,
ftp://ftp.netbsd.org/pub/pkgsrc/misc/kristerw/pkgstat/Darwin/20060205.1859/print/ja-vflib-lib/.broken.html
following problem is flagged for Darwin 8.4.0:

| fman.c: In function '___VFFM_Intern':
| fman.c:240: warning: assignment makes integer from pointer without a cast
| fman.c: In function 'CacheIt':
| fman.c:483: error: invalid storage class for function 'ReturnCache'

I got the same thing.
>How-To-Repeat:
	
        In the pkgsrc environment with Mac OS X 10.4.x,
	cd /usr/pkgsrc/print/ja-vflib-lib
        sudo bmake package
>Fix:

This is to be fixed by the patch in following article:

| To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST at lists.debian.org
| with a subject of "unsubscribe". Trouble? Contact listmaster at lists.debian.org
| 
| From: Andreas Jochens 
| Newsgroups: linux.debian.bugs.dist
| Subject: Bug#297945: vflib2: FTBFS (amd64/gcc-4.0): static declaration of 'ReturnCache' follows non-static declaration
| Package: vflib2
| Severity: normal
| Tags: patch

When building 'vflib2' on amd64 with gcc-4.0,
I get the following error:

fman.c:491: warning: implicit declaration of function 'ReturnCache'
fman.c: At top level:
fman.c:526: warning: conflicting types for 'ReturnCache'
fman.c:526: error: static declaration of 'ReturnCache' follows non-static declaration
fman.c:491: error: previous implicit declaration of 'ReturnCache' was here
fman.c: In function 'LRUMoveTop':
fman.c:545: error: invalid storage class for function 'LRUPutTop2'
fman.c:551: warning: implicit declaration of function 'LRUPutTop2'
fman.c: In function 'LRUPutTop':
fman.c:561: error: invalid storage class for function 'LRUPutTop2'
fman.c: At top level:
fman.c:568: error: static declaration of 'LRUPutTop2' follows non-static declaration
fman.c:551: error: previous implicit declaration of 'LRUPutTop2' was here
make[3]: *** [fman.lo] Error 1
make[3]: Leaving directory `/vflib2-2.25.1/src'

With the attached patch 'vflib2' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/vflib2-2.25.1/src/VF_FNTWV.c ./src/VF_FNTWV.c
--- ../tmp-orig/vflib2-2.25.1/src/VF_FNTWV.c	1998-07-09 11:33:43.000000000 +0200
+++ ./src/VF_FNTWV.c	2005-03-03 18:55:43.978940235 +0100
@@ -176,6 +176,7 @@
 Private long   read_long();
 
 
+Private int  ReadCapa();
 
 Public FontObj*
 CreateFont_FontWave(ent)
@@ -183,7 +184,6 @@
 {
   Font     *font;
   FontObj  *fobj;
-  Private int  ReadCapa();
 
   if ((font = (Font*) malloc(sizeof(Font))) == NULL){
     printf("in CreateFont malloc() Error!\n");
@@ -217,22 +217,22 @@
 }
        
 
+Private int   FNTWVOpenFont();
+
 Private int
 OpenFont(obj)
   FontObj *obj;
 {
-  Private int   FNTWVOpenFont();
-
   return FNTWVOpenFont((Font*) obj->Locals);
 }
 
 
+Private int   FNTWVCloseFont();
+
 Private int
 CloseFont(obj)
   FontObj  *obj;
 {
-  Private int   FNTWVCloseFont();
-
   return FNTWVCloseFont((Font*) obj->Locals);
 }
 
diff -urN ../tmp-orig/vflib2-2.25.1/src/fman.c ./src/fman.c
--- ../tmp-orig/vflib2-2.25.1/src/fman.c	1999-05-10 10:05:20.000000000 +0200
+++ ./src/fman.c	2005-03-03 18:51:01.724420565 +0100
@@ -471,6 +471,8 @@
 }
 
 
+Private void  ReturnCache();
+
 /*
  * CacheIt() --- cache it.  The cache slot is moved into
  *   the head of the LRU list.
@@ -480,7 +482,6 @@
      int port;
 {
   CACHE         *cptr;
-  Private void  ReturnCache();
 
   if ((cptr = RequireCache()) == (CACHE*)NULL){
     fprintf(stderr, "VFlib: CacheIt() - error\n");
@@ -534,6 +535,8 @@
  ** LRU LIST  
  **/
 
+Private int LRUPutTop2();
+
 /* LRUMoveTop()  - moves a cache block into the top of LRU list.
  *   THE CACHE *MUST* BE IN LRU LIST.
  */
@@ -542,7 +545,6 @@
   CACHE  *cptr;
 {
   CACHE       *cptr_b, *cptr_f;
-  Private int LRUPutTop2();
 
   cptr_b         = cptr->l_back;
   cptr_f         = cptr->l_forw;
@@ -551,6 +553,8 @@
   return LRUPutTop2(cptr, FALSE);
 }
 
+Private int LRUPutTop2();
+
 /* LRUPutTop()  - puts a cache into the top of LRU list.
  *   THE CACHE *MUST NOT* BE IN LRU LIST.
  */
@@ -558,7 +562,6 @@
 LRUPutTop(cptr)
   CACHE  *cptr;
 {
-  Private int LRUPutTop2();
 
   return LRUPutTop2(cptr, TRUE);
 }


-- 


>Unformatted: