isspace is not behaving properly when linked with -lclntsh shared library

From: Orna Berlinsky <ornab_at_amdocs.com>
Date: 14 Aug 2002 08:29:40 -0700
Message-ID: <4e2fb3ee.0208140729.60b9203a_at_posting.google.com>


Hi,

I have the following short program :
 ... ( includes.. )

void test_popai() {
  char in_s[50] ="Éate6É";
  char *s;
for (s=in_s; *s; s++) if ( isspace(*s)) printf("%c (%x) is space\n",*s,*s);
}

and I am executing it inside a one line cobol program :

         call "test_popai".

Compilation and link :
I create two executables :
x : is not linked with Oracle shared library lclntsh y : is linked with lclntsh

/opt/ansic/bin/cc -c -g -Ae -Wp,-H100000 -DNO_LIANT -DOP_HP
-I/usr/include -I/opt/CC/include/CC popai.c
/opt/cobol/bin/cob -acx x.cbl
/opt/cobol/bin/cob -x -o /tmp/x x.o popai.o
/opt/cobol/bin/cob -x -o /tmp/y x.o popai.o
-L/oravl01/oracle/8.0.6.3/lib -lclntsh

When executing x I get no output, i.e non of the characters in 'Éate6É' is identified as a space by the isspace.

However , when executing y :

### É (ffffffc9) is space
### É (ffffffc9) is space

For some reason , the É character is identified by the isspace as a space when linked with lclntsh and executed by a cobol program. Interesting to mention that it dos not happen when the main is a C program and not a COBOL program.

Any idea ??
thanks
Orna Received on Wed Aug 14 2002 - 17:29:40 CEST

Original text of this message