Very simple C program ... does not work
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues, Internationalization & Character Sets
Hi all.
We are migrating from:
- SCO Unix OS5.02
- SCO cc compiler 5.02
- INFORMIX-4GL Version 6.04.UC1
to:
- Solaris 2.6
- gcc compiler 2.8.1
- INFORMIX-4GL Version 7.20.UD7.
The following simple C program did work on the old server, and dumps a core
on the new one:
# cat TEST.c
main()
{
int fgl_svstk, fgl_nret;
/* start log file */
fgl_svstk = mark_stack();
pushquote("/tmp/informix.log", 17);
fgl_nret = startlog(1);
rest_stack(fgl_svstk);
/* test log file */
fgl_svstk = mark_stack();
pushquote("test", 4);
fgl_nret = errorlog(1);
rest_stack(fgl_svstk);
}
The program is compiled with c4gl:
- Version 6.04.UC1:
# c4gl TEST.c -o TEST
cc -I/usr/informix/incl/tools -I/usr/informix/incl/esql TEST.o -o
TEST -L/usr/informix/lib/tools -l4gl -lnforms -lfesql -los -lasf
/usr/informix/lib/tools/netlib.a -los -lasf -lgen -lnsl_s -lprot -lsocket -l
x -lcurses -lm -lcrypt_i -lm -lcurses
- Version 7.20.UD7:
# c4gl TEST.c -fwritables-strings -o TEST
/usr/local/bin/gcc -DASIAN -I/usr/informix/incl/tools -I/usr/informix/incl/e
sql -fwritable-strings TEST.o -o
TEST -L/usr/informix/lib/tools -l4gl -lnforms -lfesql -los -lasf
/usr/informix/lib/tools/libasf.a -los -lasf -lgen -lnsl -lsocket -laio -lm -
ltermlib /usr/informix/lib/tools/libgls.a /usr/informix/lib/tools/libglx.a
gdb indicates that the program stops when executing the
'fgl_nret=startlog(1);' statement.
Please should you have suggestions to fix that ?
Thanks in advance for any help.
Philippe
ummm....I am not certain if I should be asking this...but are the
permissions on "/tmp/informix.log" right ? It should be writable
cheers
In article <81bjlq$deh$1@wanadoo.fr>,
"Ph. Chantry" <chantry@seditel.REMOVE.fr> wrote:
> Hi all.
>
> We are migrating from:
> - SCO Unix OS5.02
> - SCO cc compiler 5.02
> - INFORMIX-4GL Version 6.04.UC1
>
> to:
> - Solaris 2.6
> - gcc compiler 2.8.1
> - INFORMIX-4GL Version 7.20.UD7.
>
> The following simple C program did work on the old server, and dumps a
core
> on the new one:
>
> # cat TEST.c
> main()
> {
> int fgl_svstk, fgl_nret;>
> /* start log file */
> fgl_svstk = mark_stack();
> pushquote("/tmp/informix.log", 17);
> fgl_nret = startlog(1);
> rest_stack(fgl_svstk);
>
> /* test log file */
> fgl_svstk = mark_stack();
> pushquote("test", 4);
> fgl_nret = errorlog(1);
> rest_stack(fgl_svstk);
> }
>
> The program is compiled with c4gl:
> - Version 6.04.UC1:
> # c4gl TEST.c -o TEST
> cc -I/usr/informix/incl/tools -I/usr/informix/incl/esql TEST.o -o
> TEST -L/usr/informix/lib/tools -l4gl -lnforms -lfesql -los -lasf
> /usr/informix/lib/tools/netlib.a -los -lasf -lgen -lnsl_s -lprot
-lsocket -l
> x -lcurses -lm -lcrypt_i -lm -lcurses
>
> - Version 7.20.UD7:
> # c4gl TEST.c -fwritables-strings -o TEST
> /usr/local/bin/gcc -DASIAN -I/usr/informix/incl/tools
-I/usr/informix/incl/e
> sql -fwritable-strings TEST.o -o
> TEST -L/usr/informix/lib/tools -l4gl -lnforms -lfesql -los -lasf
> /usr/informix/lib/tools/libasf.a -los -lasf -lgen -lnsl -lsocket -laio
-lm -
> ltermlib /usr/informix/lib/tools/libgls.a
/usr/informix/lib/tools/libglx.a
>
> gdb indicates that the program stops when executing the
> 'fgl_nret=startlog(1);' statement.
>
> Please should you have suggestions to fix that ?
>
> Thanks in advance for any help.
>
> Philippe
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
In article <81bjlq$deh$1@wanadoo.fr>, "Ph. Chantry" <chantry@seditel.REMOVE.fr> wrote: > Hi all. > > We are migrating from: > - SCO Unix OS5.02 > - SCO cc compiler 5.02 > - INFORMIX-4GL Version 6.04.UC1 > > to: > - Solaris 2.6 > - gcc compiler 2.8.1 > - INFORMIX-4GL Version 7.20.UD7. > > The following simple C program did work on the old server, and dumps a core > on the new one: I believe that to use 4GL with gcc you have to pass the flag: -fwriteable_strings so that the static string table will be in a writable segment. By default gcc places these in a read-only segment. This may be your problem. Art S. Kagel Sent via Deja.com http://www.deja.com/ Before you buy.