[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Addresses of variables
From: |
Vincent Lefevre |
Subject: |
Re: [Tinycc-devel] Addresses of variables |
Date: |
Sun, 11 Apr 2010 13:05:18 +0200 |
User-agent: |
Mutt/1.5.20-6072-vl-r35499 (2010-04-03) |
On 2010-04-11 02:37:22 -0900, Alexei wrote:
> Isn't it a BUG?
>
> #include <stdio.h>
> int main(int argc, char **argv)
> {
> int first;
> int second;
> printf("&first=%08X &second=%08X",&first,&second);
> return 0;
> }
> ---------------------------------
> &first=0012FF94 &second=0012FF90
This isn't a bug: %08X takes an unsigned int, not a pointer.
You need:
printf("&first=%p &second=%p", (void *) &first, (void *) &second);
--
Vincent Lefèvre <address@hidden> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)