Mail Archives: djgpp-workers/2000/07/20/09:27:19
> Yes. Please re-read my message elaborating on __null semantics. Usage
> of __null does not result in an assembler-level reference to a symbol
> named __null; there is no such symbol. As a result, libc.a does not
> need to provide anything.
>
> Instead, cc1plus will emit 'zero' immediate values in assembler,
> depending on the assembler language (e.g. clearing eax).
>
Eli, this appears to be correct:
#include <stdio.h>
int main()
{
char *null1 = __null;
char *null2 = NULL;
return 0;
}
.file "null.cpp"
gcc2_compiled.:
___gnu_compiled_cplusplus:
.section .text
.p2align 2
.globl _main
_main:
pushl %ebp
movl %esp,%ebp
subl $24,%esp
movl $0,-4(%ebp)
movl $0,-8(%ebp)
xorl %eax,%eax
jmp L2
xorl %eax,%eax
jmp L2
.p2align 4,,7
L2:
movl %ebp,%esp
popl %ebp
ret
- Raw text -