I did 'setenv A' in ~/.tcshrc and 'unsetenv A' on tcsh.
I executed the following program (test_gdb.c) on gdb. The behavior is
different from that on tcsh. NULL is not printed on gdb.

~/.tcshrc:

setenv A

test_gdb.c:

#include <stdio.h>
#include <stdlib.h>

int main(){
        if(getenv("A") == NULL){
                printf("NULL\n");
        }
        return 0;
}

> unsetenv A
> gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.7.2.3/specs
gcc version 2.7.2.3
> gcc -g test_gdb.c
> ./a.out
NULL
> gdb a.out
(gdb) r
Starting program: /home/susukita/a.out 

Program exited normally.
--------------------------------------------
Computational Science Division
The Institute of Physics and Chemistry(RIKEN)
SUSUKITA Ryutaro

Reply via email to