|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26056 Warnings while compiling exif.c
Submitted: 2003-10-31 09:27 UTC Modified: 2005-02-01 23:00 UTC
From: AxelLuttgens at swing dot be Assigned: helly (profile)
Status: Closed Package: EXIF related
PHP Version: 4CVS OS: Darwin 7.0.0 (Panther)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
35 - 15 = ?
Subscribe to this entry?

 [2003-10-31 09:27 UTC] AxelLuttgens at swing dot be
When compiling PHP, I get two warnings related to lines 1555 and 1582 of exif.c; both warnings read:

warning: passing arg 3 of `php_addslashes' from incompatible pointer type

Function php_addslashes gets called 4 times in file ext/exif/exif.c (/* $Id: exif.c,v 2003/06/25 13:21:54 edink Exp $ */).

In function exif_iif_add_value, where argument 'length' is of type size_t:
   line 1555: info_value->s = php_addslashes(value, length, &length, 0 TSRMLS_CC);
   line 1582: info_value->s = php_addslashes(value, length, &length, 0 TSRMLS_CC);

In function exif_iif_add_str:
    line 1708: info_data->value.s = php_addslashes(value, strlen(value), NULL, 0 TSRMLS_CC);

In function exif_iif_add_buffer, where argument 'length' is of type int:
    line 1756: info_data->value.s = php_addslashes(value, length, &length, 0 TSRMLS_CC);

In ext/standard/string.c, definition of php_addsclashes reads as:

PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_free TSRMLS_DC)

which is consistent with what appears in ext/standard/php_string.h:

PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit TSRMLS_DC);

Clearly, line 1708 is a don't care, and line 1756 is just compliant with the definition of php_addslashes.
But lines 1555 and 1582 both use a length of type size_t instead of type int.

I am wondering what the compiler really compiles (as it just warns and goes on).
Could this be a source of confusion (such as an unsigned long being interpreted as a signed one)?

And would it be safe to just change the definition of function exif_iif_add_value so as to set type of argument 'lentgh' to int instead of size_t?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-08 09:15 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

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

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Dec 05 18:03:43 2022 UTC