[nhc-bugs] Problems with System.getEnv when compiling with "-T"

Matthias Neubauer neubauer@informatik.uni-freiburg.de
17 Apr 2002 16:32:33 +0200


Dear nhc team,

when accessing environment variables in a program compiled for
tracing, the resulting strings always seem a little bit "too short".

Consider the following program "Moo.hs":

| import System
| main = do host <- getEnv "HOST"
|           print host

When compiled without option "-T", it outputs on my system as expected

/tmp> hmake  Moo
nhc98   -c  -o Moo.o Moo.hs
nhc98    -o Moo Moo.o 
/tmp> ./Moo
"nakalele"
/tmp>

whereas, when compiled with "-T", I get:

/tmp> hmake -T Moo
nhc98  -T  -c  -o Moo.T.o Moo.hs
nhc98  -T   -o Moo Moo.T.o 
/tmp> ./Moo 
"nakalel"
/tmp> 

This is nhc98-1.12 by the way built from the source distribution on a
Suse Linux PC.

/tmp> uname -a
Linux nakalele 2.2.19 #7 SMP Wed May 23 15:25:41 CEST 2001 i686 unknown

Cheers,

  Matthias


-- 
Matthias Neubauer                                       |
Universität Freiburg, Institut für Informatik           | tel +49 761 203 8060
Georges-Köhler-Allee 79, 79110 Freiburg i. Br., Germany | fax +49 761 203 8242