php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24156 T undefined during compile of php_imap.c
Submitted: 2003-06-12 13:03 UTC Modified: 2003-06-18 13:16 UTC
Votes:3
Avg. Score:3.7 ± 1.9
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: barryn at baptisthealth dot net Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 4.3.2 OS: Solaris 8
Private report: No CVE-ID: None
 [2003-06-12 13:03 UTC] barryn at baptisthealth dot net
Description:
------------
Compiling with these switches:
./configure --prefix=/opt/php --with-nsapi=/opt/netscape --with-oci8 --enable-dbase --enable-filepro --enable-ftp --enable-sysvsem --enable-sysvshm --with-zlib --with-jpeg-dir=/opt/sfw --with-png-dir=/opt/sfw --with-gdbm --with-gd --with-imap --with-mysql --enable-sigchild --enable-libgcc --with-cpdflib --with-flatfile
on Solaris 8 resulted in T being undefined when compiling php_imap.c

Imap version info:
 * Program:     Interactive Mail Access Protocol 4rev1 (IMAP4R1) routines
 *
 * Author:      Mark Crispin
 *              Networks and Distributed Computing
 *              Computing & Communications
 *              University of Washington
 *              Administration Building, AG-44
 *              Seattle, WA  98195
 *              Internet: MRC@CAC.Washington.EDU
 *
 * Date:        14 October 1988
 * Last Edited: 14 November 2001

Reproduce code:
---------------
I fixed the problem by adding:

#ifndef T
#define T 1
#endif

after the line
#define PHP_IMAP_ADDRESS_SIZE_BUF 10
in php_imap.c


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-12 13:15 UTC] derick@php.net
Please add the full error message here.
 [2003-06-12 13:26 UTC] barryn at baptisthealth dot net
My source no longer generates this error. Please read the full bug description. OBVIOUSLY the error was something to effect of:
`T' undeclared (first use in this function)
(Each undeclared identifier is reported only once
for each function it appears in.)

The line number in the source code was 1117
 [2003-06-12 13:28 UTC] derick@php.net
I need the full *original* error, so remove your hack and recompile again. It works fine here.
 [2003-06-12 13:47 UTC] barryn at baptisthealth dot net
I have no more time to assist with this. Here is the information you requested. You fix this problem (which probably only occurs with certain versions of the imap headers, maybe only on Solaris) by adding the code I included, which will do nothing if T is already defined.
Or not...
It's up the powers that be that maintain this package.
Whatever.

Here's the error text:

/bin/sh /usr/share/src/php-4.3.2/libtool --silent --preserve-dup-deps --mode=compile /usr/share/src/php-4.3.2/meta_ccld  -Iext/imap/ -I/usr/share/src/php-4.3.2/ext/imap/ -DPHP_ATOM_INC -I/usr/share/src/php-4.3.2/include -I/usr/share/src/php-4.3.2/main -I/usr/share/src/php-4.3.2 -I/opt/netscape/plugins/include -I/usr/share/src/php-4.3.2/Zend -I/opt/sfw/include -I/opt/app/oracle/product/8.1.6/rdbms/public -I/opt/app/oracle/product/8.1.6/rdbms/demo -I/opt/app/oracle/product/8.1.6/network/public -I/usr/share/src/php-4.3.2/ext/xml/expat  -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/usr/share/src/php-4.3.2/TSRM -DTHREAD=1  -O2 -I/opt/app/oracle/product/8.1.6/rdbms/demo -I/opt/app/oracle/product/8.1.6/rdbms/public -I/opt/app/oracle/product/8.1.6/network/public -pthreads -DZTS  -prefer-pic -c /usr/share/src/php-4.3.2/ext/imap/php_imap.c -o ext/imap/php_imap.lo
/usr/share/src/php-4.3.2/ext/imap/php_imap.c: In function `zif_imap_mail_copy':
/usr/share/src/php-4.3.2/ext/imap/php_imap.c:1117: `T' undeclared (first use in this function)
/usr/share/src/php-4.3.2/ext/imap/php_imap.c:1117: (Each undeclared identifier is reported only once
/usr/share/src/php-4.3.2/ext/imap/php_imap.c:1117: for each function it appears in.)
/usr/share/src/php-4.3.2/ext/imap/php_imap.c: In function `zif_imap_mail_move':
/usr/share/src/php-4.3.2/ext/imap/php_imap.c:1145: `T' undeclared (first use in this function)
/usr/share/src/php-4.3.2/ext/imap/php_imap.c: In function `zif_imap_createmailbox':
/usr/share/src/php-4.3.2/ext/imap/php_imap.c:1168: `T' undeclared (first use in this function)
/usr/share/src/php-4.3.2/ext/imap/php_imap.c: In function `zif_imap_renamemailbox':
/usr/share/src/php-4.3.2/ext/imap/php_imap.c:1192: `T' undeclared (first use in this function)
/usr/share/src/php-4.3.2/ext/imap/php_imap.c: In function `zif_imap_deletemailbox':
/usr/share/src/php-4.3.2/ext/imap/php_imap.c:1215: `T' undeclared (first use in this function)
/usr/share/src/php-4.3.2/ext/imap/php_imap.c: In function `zif_imap_subscribe':
/usr/share/src/php-4.3.2/ext/imap/php_imap.c:1648: `T' undeclared (first use in this function)
/usr/share/src/php-4.3.2/ext/imap/php_imap.c: In function `zif_imap_unsubscribe':
/usr/share/src/php-4.3.2/ext/imap/php_imap.c:1671: `T' undeclared (first use in this function)
*** Error code 1
make: Fatal error: Command failed for target `ext/imap/php_imap.lo'
 [2003-06-13 04:18 UTC] sniper@php.net
If that constant is not defined, it's really something
broken in your c-client headers, not by any chance in PHP.



 [2003-06-17 15:11 UTC] barryn at baptisthealth dot net
It is defined, in a file php did not include.

Top lines from /usr/include/mail.h

/*
 * Program:     Mailbox Access routines
 *
 * Author:      Mark Crispin
 *              Networks and Distributed Computing
 *              Computing & Communications
 *              University of Washington
 *              Administration Building, AG-44
 *              Seattle, WA  98195
 *              Internet: MRC@CAC.Washington.EDU
 *
 * Date:        22 November 1989
 * Last Edited: 13 November 2001
 *
 * The IMAP toolkit provided in this Distribution is
 * Copyright 2001 University of Washington.
 * The full text of our legal notices is contained in the file called
 * CPYRIGHT, included with this Distribution.
 */
#ifndef INCMAILH
#define INCMAILH 1

/* Build parameters */

#define CACHEINCREMENT 250      /* cache growth increments */
#define MAILTMPLEN 1024         /* size of a temporary buffer */
#define MAXMESSAGESIZE 65000    /* MS-DOS: maximum text buffer size
                                 * other:  initial text buffer size */
#define MAXUSERFLAG 64          /* maximum length of a user flag */
#define MAXAUTHENTICATORS 8     /* maximum number of SASL authenticators */


/* These can't be changed without changing code */

#define NUSERFLAGS 30           /* maximum number of user flags */
#define BASEYEAR 1970           /* the year time began on Unix DON'T CHANGE */
                                /* default for unqualified addresses */
#define BADHOST ".MISSING-HOST-NAME."
                                /* default for syntax errors in addresses */
#define ERRHOST ".SYNTAX-ERROR."


/* Coddle certain compilers' 6-character symbol limitation */

#ifdef __COMPILER_KCC__
#include "shortsym.h"
#endif


/* Function status code */

#define NIL 0                   /* convenient name */
#define T 1                     /* opposite of NIL */
#define LONGT (long) 1          /* long T */
#define VOIDT (void *) ""       /* void T */

/* Global and Driver Parameters */
 [2003-06-18 13:16 UTC] sniper@php.net
Wild guess: You have mixed versions of c-client libs in your system, one is used during configure and one actually during make, and this we can't prevent. 

Clear up your system of any remrants of old c-client libs and headers and install the new version after you have read the instructions here:

http://www.php.net/imap

And pay lot of attention to the part about copying the libs/headers under their own directory, e.g. /usr/local/c-client/lib and /usr/local/c-client/include
and use --with-imap=/usr/local/c-client/ and it will work just fine.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 15:01:28 2024 UTC