# [PATCH] zend_compile.c warning fix

- Thread: https://externals.io/message/12324
- Original archive: https://news-web.php.net/php.internals/12324
- Started by Joe Orton on 2004-08-24T14:53:41+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #12324 — Joe Orton — 2004-08-24T14:53:41+00:00

URL: https://externals.io/message/12324#12324

If casting pointers to integers at least cast to a long, to avoid
compiler warnings:

--- Zend/zend_compile.c	23 Aug 2004 20:58:48 -0000	1.581
+++ Zend/zend_compile.c	24 Aug 2004 14:50:31 -0000
@@ -68,7 +68,7 @@
 	uint char_pos_len;
 	char *filename;
 
-	char_pos_len = zend_sprintf(char_pos_buf, "%x", (unsigned int) LANG_SCNG(_yy_last_accepting_cpos));
+	char_pos_len = zend_sprintf(char_pos_buf, "%lx", (unsigned long) LANG_SCNG(_yy_last_accepting_cpos));
 	if (CG(active_op_array)->filename) {
 		filename = CG(active_op_array)->filename;
 	} else {

---

## #12341 — Ilia Alshanetsky — 2004-08-25T00:53:15+00:00

URL: https://externals.io/message/12324#12341 · In reply to: #12324

What compiler flags are you using that you see this warning message? I do not 
see on the local build here.

Ilia


> If casting pointers to integers at least cast to a long, to avoid
> compiler warnings:
>
> --- Zend/zend_compile.c	23 Aug 2004 20:58:48 -0000	1.581
> +++ Zend/zend_compile.c	24 Aug 2004 14:50:31 -0000
> @@ -68,7 +68,7 @@
>  	uint char_pos_len;
>  	char *filename;
>
> -	char_pos_len = zend_sprintf(char_pos_buf, "%x", (unsigned int)
> LANG_SCNG(_yy_last_accepting_cpos)); +	char_pos_len =
> zend_sprintf(char_pos_buf, "%lx", (unsigned long)
> LANG_SCNG(_yy_last_accepting_cpos)); if (CG(active_op_array)->filename) {
>  		filename = CG(active_op_array)->filename;
>  	} else {

---

## #12343 — Andi Gutmans — 2004-08-25T01:01:43+00:00

URL: https://externals.io/message/12324#12343 · In reply to: #12324

Probably 64bit system?

At 08:53 PM 8/24/2004 -0400, Ilia Alshanetsky wrote:
>What compiler flags are you using that you see this warning message? I do not
>see on the local build here.
>
>Ilia
>
>
> > […]

---

## #12344 — Joe Orton — 2004-08-25T06:08:39+00:00

URL: https://externals.io/message/12324#12344 · In reply to: #12341

> What compiler flags are you using that you see this warning message? I do not 
> see on the local build here.

gcc -Wall warns, any LP64 platform.

Zend/zend_compile.c: In function `build_runtime_defined_function_key':
Zend/zend_compile.c:71: warning: cast from pointer to integer of different size

> 
> > […]
