|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 05:01:30 2024 UTC