pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/46412: Building for capc-calc-2.12.4.1 ends with 'FPOS_POS_LEN' undeclared
>Number: 46412
>Category: pkg
>Synopsis: Building for capc-calc-2.12.4.1 ends with 'FPOS_POS_LEN'
>undeclared
>Confidential: no
>Severity: critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri May 04 20:10:00 +0000 2012
>Originator: Michael L. Riechers
>Release: NetBSD 6.0_BETA, package source 1st quarter 2012
>Organization:
M L Riechers Systems Engineering
>Environment:
System: NetBSD cterm.rse.com 6.0_BETA NetBSD 6.0_BETA (GENERIC) #1: Mon Apr 30
17:12:11 EDT 2012
root%cterm.rse.com@localhost:/usr/local/src/usr/usr.201204292125Z/src/sys/arch/amd64/compile/obj/GENERIC
amd64
Architecture: x86_64
Machine: amd64
>Description:
All goes merrily forward, until:
gcc -DCALC_SRC -DCUSTOM -Wall -W -Wno-comment -O2 -I/usr/include
-I/usr/include -I/usr/include -c -o file.o file.c
file.c: In function 'filepos2z':
file.c:1366:2: error: 'FPOS_POS_LEN' undeclared (first use in this function)
file.c:1366:2: note: each undeclared identifier is reported only once for each
function it appears in
file.c: In function 'z2filepos':
file.c:1444:2: error: 'FPOS_POS_LEN' undeclared (first use in this function)
gmake: *** [file.o] Error 1
traced down to a change in stdio.h:
--- /mnt/usr/include/stdio.h 2011-11-17 18:40:35.000000000 -0500
+++ /usr/include/stdio.h 2012-04-29 17:49:41.000000000 -0400
...
@@ -64,13 +64,10 @@
* innards of an fpos_t anyway. The library internally uses off_t,
* which we assume is exactly as big as eight chars.
*/
-#if (!defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__)) || defined(_LIBC)
-typedef __off_t fpos_t;
-#else
typedef struct __sfpos {
__off_t _pos;
+ __mbstate_t _mbstate_in, _mbstate_out;
} fpos_t;
-#endif
...
fpos_t went from typedef __off_t to typedef struct ...
which somehow causes HAVE_FILEPOS_SCALAR to become undef'ed:
diff -wru ../../../capc-calc.good/work/calc-2.12.4.1/have_posscl.h ./have_posscl
--- ../../../capc-calc.good/work/calc-2.12.4.1/have_posscl.h 2012-05-03 17:09
+++ ./have_posscl.h 2012-05-04 13:15:31.000000000 -0400
@@ -7,8 +7,8 @@
#define __HAVE_POSSCL_H__
+/* FILEPOS is not a simple value */
#undef HAVE_FILEPOS_SCALAR
-#define HAVE_FILEPOS_SCALAR /* FILEPOS is a simple value */
#endif /* !__HAVE_POSSCL_H__ */
and FPOS_POS_LEN to be undef'd:
diff -wru ../../../capc-calc.good/work/calc-2.12.4.1/have_fpos_pos.h ./have_fpos
--- ../../../capc-calc.good/work/calc-2.12.4.1/have_fpos_pos.h 2012-05-03 17:09
+++ ./have_fpos_pos.h 2012-05-04 13:15:31.000000000 -0400
@@ -9,8 +9,8 @@
/* do we have fgetpos & fsetpos functions? */
#undef HAVE_FPOS_POS /* no */
+
#undef FPOS_POS_BITS
-#undef FPOS_POS_LEN
#endif /* !__HAVE_FPOS_POS_H__ */
which blew have_fpos.c's generation,
and a whole bunch of wacky values to be set:
diff -wru ../../../capc-calc.good/work/calc-2.12.4.1/fposval.h ./fposval.h
--- ../../../capc-calc.good/work/calc-2.12.4.1/fposval.h 2012-05-03 17:09
+++ ./fposval.h 2012-05-04 13:15:31.000000000 -0400
@@ -9,10 +9,10 @@
/* what are our file position & size types? */
#undef FILEPOS_BITS
-#define FILEPOS_BITS 64
+#define FILEPOS_BITS 2112
#undef FILEPOS_LEN
-#define FILEPOS_LEN 8
-#define SWAP_HALF_IN_FILEPOS(dest, src) (*(dest) = *(src))
+#define FILEPOS_LEN 264
+#define SWAP_HALF_IN_FILEPOS(dest, src) memcpy((void *)(dest), (void
*)(src), sizeof(FPOS_POS_LEN))
#undef OFF_T_BITS
#define OFF_T_BITS 64
which is how function 'z2filepos' gets FPOS_POS_LEN.
>How-To-Repeat:
cd /usr/pkgsrc/math/capc-calc; make
>Fix:
A rather nasty work-around. I made a patch to have_fpos.c thusly:
diff -u have_fpos.c ../../../capc-calc.good/work/calc-2.12.4.1/have_fpos.c
--- have_fpos.c 2007-09-01 18:01:25.000000000 -0400
+++ ../../../capc-calc.good/work/calc-2.12.4.1/have_fpos.c 2012-05-03
17:09:37.000000000 -0400
@@ -42,7 +42,7 @@
main(void)
{
#if !defined(HAVE_NO_FPOS)
- fpos_t pos; /* file position */
+ off_t pos; /* file position */
/* get the current position */
(void) fgetpos(stdin, &pos);
@@ -53,7 +53,7 @@
/* print a have_fpos.h body that says we have the functions */
printf("#undef HAVE_FPOS\n");
printf("#define HAVE_FPOS 1 /* yes */\n\n");
- printf("typedef fpos_t FILEPOS;\n");
+ printf("typedef off_t FILEPOS;\n");
#endif
/* exit(0); */
return 0;
This allowed the compile, and it seems to work for me. However, I got warnings
from the compile:
file.c: In function 'readid':
file.c:780:3: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c:782:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c: In function 'getcharid':
file.c:857:3: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c:859:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c: In function 'idprintf':
file.c:967:3: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c:968:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c: In function 'idfputc':
file.c:1194:3: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c:1195:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c: In function 'idfputs':
file.c:1256:3: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c:1257:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c: In function 'idfputstr':
file.c:1293:3: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c:1294:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c: In function 'get_open_pos':
file.c:1473:2: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c: In function 'ftellid':
file.c:1536:2: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c: In function 'fseekid':
file.c:1567:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c:1572:3: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c:1584:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c:1601:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c: In function 'set_open_pos':
file.c:1638:2: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c: In function 'fscanfile':
file.c:2291:4: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c: In function 'fscanfid':
file.c:2329:3: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c:2331:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c: In function 'fsearch':
file.c:2648:2: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c:2666:4: warning: passing argument 2 of 'fgetpos' from incompatible
pointer type
/usr/include/stdio.h:286:6: note: expected 'struct fpos_t * __restrict__' but
argument is of type 'FILEPOS *'
file.c:2683:4: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c: In function 'frsearch':
file.c:2762:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c:2774:3: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
file.c:2806:2: warning: passing argument 2 of 'fsetpos' from incompatible
pointer type
/usr/include/stdio.h:287:6: note: expected 'const struct fpos_t *' but argument
is of type 'FILEPOS *'
gcc -DCALC_SRC -DCUSTOM -Wall -W -Wno-comment -O2 -I/usr/include
-I/usr/include -I/usr/include -c -o func.o func.c
func.c: In function 'f_primetest':
func.c:1245:24: warning: operation on '_qone_.links' may be undefined
>Unformatted:
Home |
Main Index |
Thread Index |
Old Index