Florian Weimer a écrit :
* Cyprien LAPLACE:
Hum, well .. another sample test:
/* c.c */
extern void func(void*);
void test()
{
register char (*foo)[32] = (typeof(foo))0-1024;
register int index;
for(index=0;index1024;index++) {
func(foo++);
}
}
This is
* Cyprien LAPLACE:
This is still undefined. If you need machine address arithmetic, you
should use uintptr_t and hope for the best.
Does it mean that the loop indexed on an integer should become an
infinite loop ?
Not necessarily. However, the compiler may assume that foo() performs a
* Cyprien LAPLACE:
Hum, well .. another sample test:
/* c.c */
extern void func(void*);
void test()
{
register char (*foo)[32] = (typeof(foo))0-1024;
register int index;
for(index=0;index1024;index++) {
func(foo++);
}
}
This is still undefined. If you need
On Thu, Mar 27, 2008 at 12:33:58AM +0100, Cyprien LAPLACE wrote:
/* b.c */
int main()
{
register long foo = 0;
signed long. Signed integer values have no overflow behaviour in C.
Use unsigned long if you want that.
do {
asm volatile(nop::r(foo));
} while(++foo);
Can be expressed
Hum, well .. another sample test:
/* c.c */
extern void func(void*);
void test()
{
register char (*foo)[32] = (typeof(foo))0-1024;
register int index;
for(index=0;index1024;index++) {
func(foo++);
}
}
gives, in x86_32:
$ gcc-4.3 -c c.c -O3 objdump -d c.o
c.o:
/* b.c */
int main()
{
register long foo = 0;
do {
asm volatile(nop::r(foo));
} while(++foo);
return 0;
}
which gives with gcc-4.3 -O2 -c b.c:
b.o: file format elf64-x86-64
Disassembly of section .text:
main:
0: 31 c0 xor%eax,%eax
6 matches
Mail list logo