|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58098 compilation breaks with CodeWarrior compiler
Submitted: 2008-03-11 10:00 UTC Modified: 2008-03-12 12:05 UTC
From: Assigned:
Status: Closed Package: mailparse (PECL)
PHP Version: 5_2 CVS-2008-03-11 OS: NetWare
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [2008-03-11 10:00 UTC]
Stupid CodeWarrior compiler which we use to compile for NetWare platform
doesnt handle line 827 of php_mailparse_mime.c:
	struct find_part_struct find = { name, NULL };
it seems that the compiler is too stupid to take vars here, and breaks compilation. Can you perhaps use single assignment here?
Then I get a warning about var i not beeing initialized before used in line 58; looking at this I found that the compiler is right, and in addition valuepos isnt used at all - so I removed both.
See patch below which fixes both issues.

--- php_mailparse_mime.c.orig	Tue Jan 08 21:20:20 2008
+++ php_mailparse_mime.c	Tue Mar 11 15:50:54 2008
@@ -53,9 +53,7 @@
 void rfc2231_to_mime(smart_str* value_buf, char* value, int charset_p, int prevcharset_p)
 	char *strp, *startofvalue = NULL;
-	int quotes=0;
-	int valuepos;
-	int i;
+	int quotes = 0;
 	/* Process string, get positions and replace	*/
 	/* Set to start of buffer*/
@@ -77,7 +75,6 @@
 					} else {
 					 startofvalue = strp+1;
-					 valuepos = i;
@@ -824,7 +821,10 @@
 PHP_MAILPARSE_API php_mimepart *php_mimepart_find_by_name(php_mimepart *parent, const char *name TSRMLS_DC)
-	struct find_part_struct find = { name, NULL };
+	struct find_part_struct find;
+	find.searchfor = name;
+	find.foundpart = NULL;
 	php_mimepart_enum_parts(parent, find_part_callback, &find TSRMLS_CC);
 	return find.foundpart;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-12 12:05 UTC]
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

Sounds good to me, thank you for the patch.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Mar 26 22:03:37 2023 UTC