php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16008 #include syntax error in ext/imap/php_imap.h
Submitted: 2002-03-11 18:05 UTC Modified: 2002-03-11 18:12 UTC
From: stephens at ameslab dot gov Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.1.2 OS: Tru64 Unix 4.0g
Private report: No CVE-ID: None
 [2002-03-11 18:05 UTC] stephens at ameslab dot gov
When IMAP support is turned on at configure stage, the out-of-the-box file ext/imap/php_imap.h causes compile failure on lines 42, 43, 45 and 46 when using the native cc compiler.  This is because the #include statements on those lines are not started in the first column.  Support for starting preprocessor statements to the right of column one is not supported in non-gcc compilers, thus the error.

Here is a quick Bourne shell script that will detect and fix the error.

#!/bin/sh
#
BADFILE="ext/imap/php_imap.h"
BADIMAP=`grep ' #' $BADFILE`;
if [ "x$BADIMAP" != "x" ]; then
  echo "Fixing $BADFILE"
  $DFILE="${BADFILE}.orig"
  mv $BADFILE $DFILE
  sed '/^ #/s/^ #/#/' < $DFILE >$BADFILE
fi

If you retype this rather than cut-and-paste, be careful to note the spaces in the strings on the grep and sed lines.  The use of shell vars is so that this piece of script can be extended or looped to fix other such bogons in the code.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-11 18:12 UTC] derick@php.net
Fixed in CVS, thanks! It will be in 4.2.0 and higher.

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 08:01:32 2024 UTC