Functions stack stepped by gnu prolog

[email protected]
Newsgroups gmane.comp.gnu.prolog.bugs
Message-ID <[email protected]>
My source file is the following:

#include <stdio.h>
#include "gprolog.h"


int main ( int argc,char * argv[])
{
  int a = 15 ;

  printf( "BEFORE: %X\n" , a ) ;

  Start_Prolog( argc , argv ) ;

  printf( "NOW: %X\n" , a ) ;

  /* If you comment this line I get a Segmentation Fault*/
  Stop_Prolog( ) ;

  return(0);
}



This is my Makefile

GPLC=/usr/local/bin/gplc
MYCOMP=g++
PFLAGS=-C -g -v --object --c-compiler $(MYCOMP) -C -I/usr/local/include -C
-I/usr/local/gprolog-1.2.16/inc$RFLAGS=-C -v --object --c-compiler
$(MYCOMP)
RFLAGS=-C -v --object --c-compiler $(MYCOMP)

all: prb.cc
        $(GPLC) $(PFLAGS) prb.cc -o prb.o
        $(GPLC) -C -g -v --c-compiler $(MYCOMP) -o prb prb.o -L -ldl -L
-lstdc++ -L -lm


My local variables are mofidified by GNU Prolog when calling
Start_Prolog function.

Notice also that if I remove the line marked in the code, I get a
Sementation Fault.

Output:

$ ./prb
BEFORE: F
NOW: 80D8D40

Regards
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.