When I make a gcc compile command with the option "-L",I should add the gblic library path or add -D_GNU_SOURCE or the gcc will run error.
$gcc sscanf_test.c -I/si/usr/aa/include/arch -o sscanf_test_2 -m64 -L$ORACLE_HOME/precomp/lib/ -L$ORACLE_HOME/lib/ -L$ORACLE_HOME/lib/stubs/ -lc
$/tmp/ccq1Z6T1.o:function ‘main’:
sscanf_test.c:(.text+0x32):undefined reference to ‘__isoc99_sscanf’
sscanf_test.c:(.text+0xf8):undefined reference to ‘__isoc99_sscanf’
sscanf_test.c:(.text+0x1e4):undefined reference to ‘__isoc99_sscanf’
collect2: ld return 1
$gcc sscanf_test.c -I/si/usr/aa/include/arch -o sscanf_test_2 -m64 -L$ORACLE_HOME/precomp/lib/ -L$ORACLE_HOME/lib/ -L$ORACLE_HOME/lib/stubs/ -D_GNU_SOURCE
$gcc sscanf_test.c -I/si/usr/aa/include/arch -o sscanf_test_2 -m64 -L$ORACLE_HOME/precomp/lib/ -L$ORACLE_HOME/lib/ -L$ORACLE_HOME/lib/stubs/ /lib64/libc.so.6
Now, I have puzzle that why gcc need -D_GNU_SOURCE.Another machine have a similar environment can run normally without -D_GNU_SOURCE.