From: Daniel Albuschat
Subject: clisp screws my enviromnent
Date: 
Message-ID: <f8i01m$s40$03$1@news.t-online.com>
Hello,

I'm trying to execute gcc-xml with clib's "system" function.
However, I get the following error-output:

Error executing "/usr/share/gccxml-0.7/gccxml_find_flags /usr/bin/c++  "
Could not determine GCCXML_FLAGS setting.

When doing the same from within a C-application, it works as expected.

Here's my code:

(asdf:operate 'asdf:load-op :cffi)
(defpackage :cpp2lisp (:use :cl :cffi))

(in-package :cpp2lisp)

(defcfun ("system" os-system) :int     (command :string))

(defun parse-header (header)
  (let
    ((command
      (format nil "gccxml '~a' -fxml='/tmp/cpp.lisp.tmp'" header)))
    (format t "~a~%" command)
    (format t "system: ~a~%" (os-system command))))

(parse-header "test.hpp")

Here's the C test-app, for comparison:

#include <stdlib.h>
#include <stdio.h>

int main() {
    printf("system: %d\n",system("gccxml 'test.hpp' 
-fxml='/tmp/cpp.lisp.tmp'"));
}

What is going on, and how can I stop it from happening?
It seems that my environment settings are overridden or discarded.

Kind regards,

    Daniel Albuschat

From: Rob Warnock
Subject: Re: clisp screws my enviromnent
Date: 
Message-ID: <udednaPftskxrTDbnZ2dnUVZ_r3inZ2d@speakeasy.net>
Daniel Albuschat  <······@happy.viming.de> wrote:
+---------------
| What is going on, and how can I stop it from happening?
| It seems that my environment settings are overridden or discarded.
+---------------

What does (OS-SYSTEM "env") give you?
Compare that to running "env" in a shell.


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Daniel Albuschat
Subject: Re: clisp screws my enviromnent
Date: 
Message-ID: <f8k6nk$5r9$03$1@news.t-online.com>
Rob Warnock wrote:
> Daniel Albuschat  <······@happy.viming.de> wrote:
> +---------------
> | What is going on, and how can I stop it from happening?
> | It seems that my environment settings are overridden or discarded.
> +---------------
> 
> What does (OS-SYSTEM "env") give you?
> Compare that to running "env" in a shell.

Hello Rob,

when comparing the output of my lisp program that calls "env"
and "env" from a shell, there're only two differences:
SHLVL is "1" when called from the shell and "2" when called from
lisp and "OLDPWD" is missing in the lisp-env.
This doesn't sound like a serious issue at all.

I still (or even more so) can't imagine where that erroneous behaviour
might come from.

Regards,

    Daniel Albuschat