bug-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Functions stack stepped by gnu prolog


From: cegea
Subject: Functions stack stepped by gnu prolog
Date: Mon, 28 Feb 2005 13:35:04 +0100 (CET)
User-agent: SquirrelMail/1.4.4

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]