diff --git a/src/global.ml b/src/global.ml
index e36fa8b4f1fc6d27ea3af117648e97efede64e05..66a1657f7e3d0011345d26167b6a6bfab171058d 100644
--- a/src/global.ml
+++ b/src/global.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 16/01/2013 (at 17:29) by Erwan Jahier> *)
+(* Time-stamp: <modified the 18/01/2013 (at 22:24) by Erwan JAHIER> *)
 
 (** Global variables for handling command-line options. *)
 
diff --git a/src/licDump.ml b/src/licDump.ml
index d254de1530a2f5e7363a96bee5596df9be6d2e4f..4b2867a5422e76a11b3799f22206196d98bc4294 100644
--- a/src/licDump.ml
+++ b/src/licDump.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 07/01/2013 (at 11:53) by Erwan Jahier> *)
+(* Time-stamp: <modified the 18/01/2013 (at 22:05) by Erwan JAHIER> *)
 
 open Errors
 open Printf
@@ -51,13 +51,7 @@ let rec string_of_const_eff =
         (dump_long s) ^ (* XXX ? *)
         (string_of_const_eff v)
         (*     | Abstract_const_eff (s,t,v,false) -> (dump_long s)  *)
-    | Enum_const_eff   (s,t) -> 
-        if !Global.expand_enums then
-          match t with
-            | Enum_type_eff(n,l) ->  "" (* translated into an extern type *)
-            | _ -> assert false
-        else 
-          (dump_long s)
+    | Enum_const_eff   (s,t) -> (dump_long s)
     | Struct_const_eff (fl, t) -> (
         let string_of_field = 
           function (id, veff) -> 
@@ -135,9 +129,6 @@ and string_def_of_type_eff = function
   | Abstract_type_eff (i, t) -> string_def_of_type_eff t
   | Enum_type_eff (i, sl) ->
       assert (sl <>[]);
-      if !Global.expand_enums then 
-        ""  (* translated into an extern type *)
-      else
         let f sep acc s  = acc ^ sep ^ (dump_long s) in
           (List.fold_left (f ", ")  (f "" "enum {" (List.hd sl)) (List.tl sl)) ^ "}"
   | Array_type_eff (ty, sz) -> sprintf "%s^%d" (string_of_type_eff ty) sz
@@ -537,7 +528,6 @@ and (type_decl: Ident.long -> Lic.type_ -> string) =
     "type " ^ (dump_long tname) ^ 
       (match teff with
          | Enum_type_eff (_) -> 
-             if !Global.expand_enums then  ";\n" else
                 " = " ^ (string_def_of_type_eff teff) ^ ";\n"
          | External_type_eff (_) 
          | Abstract_type_eff(_,External_type_eff (_)) -> ";\n"
@@ -550,12 +540,7 @@ and (const_decl: Ident.long -> Lic.const -> string) =
     let begin_str = ("const " ^ (dump_long tname)) in
     let end_str = (string_of_const_eff ceff) ^ ";\n" in
       (match ceff with 
-         | Enum_const_eff(id, t)  -> 
-             if !Global.expand_enums then
-               (begin_str ^ " : "^(string_of_type_eff t) ^ ";\n")
-             else 
-               (* generate abstract constant *)
-               "" 
+         | Enum_const_eff(id, t)  -> "" 
          | Extern_const_eff _
          | Abstract_const_eff _ ->
              begin_str ^ " : " ^ (string_of_type_eff (Lic.type_of_const ceff)) ^ 
diff --git a/src/licPrg.ml b/src/licPrg.ml
index febb90770df7f29734241cb1d5a6000ff9524070..d97f703081b9cc374dd1e026339e46c93ca5725b 100644
--- a/src/licPrg.ml
+++ b/src/licPrg.ml
@@ -141,6 +141,58 @@ let to_file (oc: out_channel) (this:t) (main_node: Ident.idref option) =
   dump_entete oc;
   (* On imprime dans l'ordre du iter, donc pas terrible ???
   *)
+  ItemKeyMap.iter
+    (fun tn te -> 
+      if (not !Global.ec || Lic.is_extern_type te) then 
+        output_string !Global.oc (LicDump.type_decl tn te)
+    )
+    this.types;
+
+  (* for generating lv4 or ec compatible code, enum types are
+     translated into an extern type + an extern const per enums.
+
+     For instance, 
+
+     type color1 = enum { blue, white, black };
+     type color2 = enum { green, orange, yellow };
+
+     will be translated into 
+
+     type color1;
+     type color2;
+     const orange:color2;
+     const green:color2;
+     const black:color1;
+     const yellow:color2;
+     const blue:color1;
+     const white:color1;
+
+  *)
+  if !Global.expand_enums then (
+    let const_list = 
+      ItemKeyMap.fold
+        (fun tn te acc -> 
+          match te with
+            | Lic.Enum_type_eff(long, longl) ->  
+              output_string !Global.oc (LicDump.type_decl long (Lic.External_type_eff long));
+              List.rev_append (List.map (fun x -> long,x) longl) acc
+            | _ -> acc
+        )
+        this.types
+        []
+    in
+    List.iter
+      (fun (t,elt) -> 
+        let const = Lic.Extern_const_eff (elt, Lic.External_type_eff t) in
+        output_string !Global.oc (LicDump.const_decl elt const))
+      const_list;
+  );
+  ItemKeyMap.iter
+    (fun cn ce -> 
+      if (not !Global.ec || Lic.is_extern_const ce) then
+        output_string !Global.oc (LicDump.const_decl cn ce)
+    )
+    this.consts  ;
   if !Global.ec then (
     (* If no node is set a top-level, the compiler will compile every node. But the
        ec format only accepts one node (and no type nor const) 
@@ -186,19 +238,7 @@ let to_file (oc: out_channel) (this:t) (main_node: Ident.idref option) =
           | _ -> output_string !Global.oc (LicDump.node_of_node_exp_eff nexp)
     )
       this.nodes
-  );
-  ItemKeyMap.iter
-    (fun tn te -> 
-      if (not !Global.ec || Lic.is_extern_type te) then 
-        output_string !Global.oc (LicDump.type_decl tn te)
-    )
-    this.types;
-  ItemKeyMap.iter
-    (fun cn ce -> 
-      if (not !Global.ec || Lic.is_extern_const ce) then
-        output_string !Global.oc (LicDump.const_decl cn ce)
-    )
-    this.consts  
+  )
 
 (* GENERATEUR DE NOM DE VARIABLES *)
 type id_generator = string -> string
diff --git a/src/mainArgs.ml b/src/mainArgs.ml
index 8eb9a6635e22824a040832a4955c99ce17125439..01b528dc3c39d115d206fc937083a4e0809f2ebe 100644
--- a/src/mainArgs.ml
+++ b/src/mainArgs.ml
@@ -103,8 +103,9 @@ let (mkopt : t -> string list -> ?hide:bool -> ?arg:string -> Arg.spec -> string
 let set_v4_options () =
   Global.lv4 := true;
   Global.inline_iterator := true;
-  Global.expand_enums := true;
-  Global.expand_structs := true
+  Global.expand_structs := true;
+  Global.expand_enums := true
+
 let set_ec_options () =
   set_v4_options ();
   Global.ec := true;
@@ -141,7 +142,7 @@ let mkoptab (opt:t) : unit = (
     mkopt opt
       ["-ee"; "--expand-enums"]
       (Arg.Unit (fun _ -> Global.expand_enums := true))
-      [" Translate enums into integers."]
+      [" Translate enums using extern types and consts (for lv4 and ec)."]
     ;
     mkopt opt
       ["-esa"; "--expand-structs-and-arrays"]
diff --git a/test/lus2lic.log.ref b/test/lus2lic.log.ref
index e44328d285c1b045a5fdcb27337e02145563309e..7d23f614c2f7d5b7d3d32b62489f2072232d39f1 100644
--- a/test/lus2lic.log.ref
+++ b/test/lus2lic.log.ref
@@ -1,4 +1,4 @@
-Test Run By jahier on Fri Jan 18 18:21:57 2013
+Test Run By jahier on Fri Jan 18 22:54:55 2013
 Native configuration is i686-pc-linux-gnu
 
 		=== lus2lic tests ===
@@ -60,9 +60,7 @@ PASS: ./lus2lic {-o /tmp/enum0.lic should_work/enum0.lus}
 spawn ./lus2lic -ec -o /tmp/enum0.ec should_work/enum0.lus
 PASS: ./lus2lic {-ec -o /tmp/enum0.ec should_work/enum0.lus}
 spawn ec2c -o /tmp/enum0.c /tmp/enum0.ec
-EcParse: ec file must contain one node
-syntax errors...
-FAIL: Try ec2c on the result: ec2c {-o /tmp/enum0.c /tmp/enum0.ec}
+PASS: ec2c {-o /tmp/enum0.c /tmp/enum0.ec}
 spawn ./lus2lic -o /tmp/ck6.lic should_work/ck6.lus
 PASS: ./lus2lic {-o /tmp/ck6.lic should_work/ck6.lus}
 spawn ./lus2lic -ec -o /tmp/ck6.ec should_work/ck6.lus
@@ -278,7 +276,6 @@ PASS: ./lus2lic {-o /tmp/Watch.lic should_work/Watch.lus}
 spawn ./lus2lic -ec -o /tmp/Watch.ec should_work/Watch.lus
 PASS: ./lus2lic {-ec -o /tmp/Watch.ec should_work/Watch.lus}
 spawn ec2c -o /tmp/Watch.c /tmp/Watch.ec
-ecnet::GetIdentInfo : undeclared ident 'ALARM_DURATION'
 PASS: ec2c {-o /tmp/Watch.c /tmp/Watch.ec}
 spawn ./lus2lic -o /tmp/testBoite.lic should_work/testBoite.lus
 PASS: ./lus2lic {-o /tmp/testBoite.lic should_work/testBoite.lus}
@@ -327,7 +324,6 @@ PASS: ./lus2lic {-o /tmp/cst.lic should_work/cst.lus}
 spawn ./lus2lic -ec -o /tmp/cst.ec should_work/cst.lus
 PASS: ./lus2lic {-ec -o /tmp/cst.ec should_work/cst.lus}
 spawn ec2c -o /tmp/cst.c /tmp/cst.ec
-ecnet::GetIdentInfo : undeclared ident 'i'
 PASS: ec2c {-o /tmp/cst.c /tmp/cst.ec}
 spawn ./lus2lic -o /tmp/minmax5_random.lic should_work/minmax5_random.lus
 PASS: ./lus2lic {-o /tmp/minmax5_random.lic should_work/minmax5_random.lus}
@@ -592,7 +588,6 @@ PASS: ./lus2lic {-o /tmp/enum.lic should_work/enum.lus}
 spawn ./lus2lic -ec -o /tmp/enum.ec should_work/enum.lus
 PASS: ./lus2lic {-ec -o /tmp/enum.ec should_work/enum.lus}
 spawn ec2c -o /tmp/enum.c /tmp/enum.ec
-ecnet::GetIdentInfo : undeclared ident 'bleu'
 PASS: ec2c {-o /tmp/enum.c /tmp/enum.ec}
 spawn ./lus2lic -o /tmp/param_node4.lic should_work/param_node4.lus
 PASS: ./lus2lic {-o /tmp/param_node4.lic should_work/param_node4.lus}
@@ -671,9 +666,7 @@ PASS: ./lus2lic {-o /tmp/over3.lic should_work/over3.lus}
 spawn ./lus2lic -ec -o /tmp/over3.ec should_work/over3.lus
 PASS: ./lus2lic {-ec -o /tmp/over3.ec should_work/over3.lus}
 spawn ec2c -o /tmp/over3.c /tmp/over3.ec
-EcParse: ec file must contain one node
-syntax errors...
-FAIL: Try ec2c on the result: ec2c {-o /tmp/over3.c /tmp/over3.ec}
+PASS: ec2c {-o /tmp/over3.c /tmp/over3.ec}
 spawn ./lus2lic -o /tmp/complex.lic should_work/complex.lus
 PASS: ./lus2lic {-o /tmp/complex.lic should_work/complex.lus}
 spawn ./lus2lic -ec -o /tmp/complex.ec should_work/complex.lus
@@ -913,9 +906,7 @@ PASS: ./lus2lic {-o /tmp/type_decl.lic should_work/type_decl.lus}
 spawn ./lus2lic -ec -o /tmp/type_decl.ec should_work/type_decl.lus
 PASS: ./lus2lic {-ec -o /tmp/type_decl.ec should_work/type_decl.lus}
 spawn ec2c -o /tmp/type_decl.c /tmp/type_decl.ec
-EcParse: ec file must contain one node
-syntax errors...
-FAIL: Try ec2c on the result: ec2c {-o /tmp/type_decl.c /tmp/type_decl.ec}
+PASS: ec2c {-o /tmp/type_decl.c /tmp/type_decl.ec}
 spawn ./lus2lic -o /tmp/import1.lic should_work/import1.lus
 PASS: ./lus2lic {-o /tmp/import1.lic should_work/import1.lus}
 spawn ./lus2lic -ec -o /tmp/import1.ec should_work/import1.lus
@@ -1330,6 +1321,12 @@ spawn ./lus2lic -ec -o /tmp/iterate.ec should_work/iterate.lus
 PASS: ./lus2lic {-ec -o /tmp/iterate.ec should_work/iterate.lus}
 spawn ec2c -o /tmp/iterate.c /tmp/iterate.ec
 PASS: ec2c {-o /tmp/iterate.c /tmp/iterate.ec}
+spawn ./lus2lic -o /tmp/overload.lic should_work/overload.lus
+PASS: ./lus2lic {-o /tmp/overload.lic should_work/overload.lus}
+spawn ./lus2lic -ec -o /tmp/overload.ec should_work/overload.lus
+PASS: ./lus2lic {-ec -o /tmp/overload.ec should_work/overload.lus}
+spawn ec2c -o /tmp/overload.c /tmp/overload.ec
+PASS: ec2c {-o /tmp/overload.c /tmp/overload.ec}
 spawn ./lus2lic -o /tmp/PCOND.lic should_work/PCOND.lus
 PASS: ./lus2lic {-o /tmp/PCOND.lic should_work/PCOND.lus}
 spawn ./lus2lic -ec -o /tmp/PCOND.ec should_work/PCOND.lus
@@ -1599,7 +1596,7 @@ spawn ./lus2lic -o /tmp/m.lic should_fail/semantics/m.lus
 *** syntax error
 
 XFAIL: Test bad programs (semantics): lus2lic {-o /tmp/m.lic should_fail/semantics/m.lus}
-testcase ./lus2lic.tests/non-reg.exp completed in 157 seconds
+testcase ./lus2lic.tests/non-reg.exp completed in 141 seconds
 Running ./lus2lic.tests/progression.exp ...
 spawn ./lus2lic -o /tmp/when_enum.out should_work/broken/when_enum.lus
 *** Error in file "/home/jahier/lus2lic/test/should_work/broken/when_enum.lus", line 10, col 12 to 15, token 'toto':
@@ -2048,10 +2045,6 @@ spawn ./lus2lic -ec -o /tmp/ts02.ec should_work/broken/ts02.lus
 ***    real and int are not unifiable
 
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/ts02.ec  should_work/broken/ts02.lus}
-spawn ./lus2lic -o /tmp/overload.out should_work/broken/overload.lus
-PASS: ./lus2lic {    -o /tmp/overload.out should_work/broken/overload.lus}
-spawn ./lus2lic -ec -o /tmp/overload.ec should_work/broken/overload.lus
-PASS: ./lus2lic {-ec -o /tmp/overload.ec  should_work/broken/overload.lus}
 spawn ./lus2lic -o /tmp/main.out should_work/broken/main.lus
 PASS: ./lus2lic {    -o /tmp/main.out should_work/broken/main.lus}
 spawn ./lus2lic -ec -o /tmp/main.ec should_work/broken/main.lus
@@ -2139,9 +2132,9 @@ testcase ./lus2lic.tests/progression.exp completed in 7 seconds
 
 		=== lus2lic Summary ===
 
-# of expected passes		712
-# of unexpected failures	82
+# of expected passes		716
+# of unexpected failures	79
 # of unexpected successes	8
 # of expected failures		26
 # of unresolved testcases	5
-runtest completed at Fri Jan 18 18:24:41 2013
+runtest completed at Fri Jan 18 22:57:23 2013
diff --git a/test/lus2lic.sum b/test/lus2lic.sum
index f65501394a9896f010b75a232ba430ab05129fa0..ac71833c4b7a04957b779f82181c42e81066df64 100644
--- a/test/lus2lic.sum
+++ b/test/lus2lic.sum
@@ -1,4 +1,4 @@
-Test Run By jahier on Fri Jan 18 18:21:57 2013
+Test Run By jahier on Fri Jan 18 22:54:55 2013
 Native configuration is i686-pc-linux-gnu
 
 		=== lus2lic tests ===
@@ -32,7 +32,7 @@ PASS: ./lus2lic {-ec -o /tmp/nodeparam.ec should_work/nodeparam.lus}
 PASS: ec2c {-o /tmp/nodeparam.c /tmp/nodeparam.ec}
 PASS: ./lus2lic {-o /tmp/enum0.lic should_work/enum0.lus}
 PASS: ./lus2lic {-ec -o /tmp/enum0.ec should_work/enum0.lus}
-FAIL: Try ec2c on the result: ec2c {-o /tmp/enum0.c /tmp/enum0.ec}
+PASS: ec2c {-o /tmp/enum0.c /tmp/enum0.ec}
 PASS: ./lus2lic {-o /tmp/ck6.lic should_work/ck6.lus}
 PASS: ./lus2lic {-ec -o /tmp/ck6.ec should_work/ck6.lus}
 PASS: ec2c {-o /tmp/ck6.c /tmp/ck6.ec}
@@ -335,7 +335,7 @@ PASS: ./lus2lic {-ec -o /tmp/over2.ec should_work/over2.lus}
 PASS: ec2c {-o /tmp/over2.c /tmp/over2.ec}
 PASS: ./lus2lic {-o /tmp/over3.lic should_work/over3.lus}
 PASS: ./lus2lic {-ec -o /tmp/over3.ec should_work/over3.lus}
-FAIL: Try ec2c on the result: ec2c {-o /tmp/over3.c /tmp/over3.ec}
+PASS: ec2c {-o /tmp/over3.c /tmp/over3.ec}
 PASS: ./lus2lic {-o /tmp/complex.lic should_work/complex.lus}
 PASS: ./lus2lic {-ec -o /tmp/complex.ec should_work/complex.lus}
 PASS: ec2c {-o /tmp/complex.c /tmp/complex.ec}
@@ -455,7 +455,7 @@ PASS: ./lus2lic {-ec -o /tmp/activation2.ec should_work/activation2.lus}
 PASS: ec2c {-o /tmp/activation2.c /tmp/activation2.ec}
 PASS: ./lus2lic {-o /tmp/type_decl.lic should_work/type_decl.lus}
 PASS: ./lus2lic {-ec -o /tmp/type_decl.ec should_work/type_decl.lus}
-FAIL: Try ec2c on the result: ec2c {-o /tmp/type_decl.c /tmp/type_decl.ec}
+PASS: ec2c {-o /tmp/type_decl.c /tmp/type_decl.ec}
 PASS: ./lus2lic {-o /tmp/import1.lic should_work/import1.lus}
 PASS: ./lus2lic {-ec -o /tmp/import1.ec should_work/import1.lus}
 PASS: ec2c {-o /tmp/import1.c /tmp/import1.ec}
@@ -663,6 +663,9 @@ PASS: ec2c {-o /tmp/speedcontrol.c /tmp/speedcontrol.ec}
 PASS: ./lus2lic {-o /tmp/iterate.lic should_work/iterate.lus}
 PASS: ./lus2lic {-ec -o /tmp/iterate.ec should_work/iterate.lus}
 PASS: ec2c {-o /tmp/iterate.c /tmp/iterate.ec}
+PASS: ./lus2lic {-o /tmp/overload.lic should_work/overload.lus}
+PASS: ./lus2lic {-ec -o /tmp/overload.ec should_work/overload.lus}
+PASS: ec2c {-o /tmp/overload.c /tmp/overload.ec}
 PASS: ./lus2lic {-o /tmp/PCOND.lic should_work/PCOND.lus}
 PASS: ./lus2lic {-ec -o /tmp/PCOND.ec should_work/PCOND.lus}
 PASS: ec2c {-o /tmp/PCOND.c /tmp/PCOND.ec}
@@ -820,8 +823,6 @@ PASS: ./lus2lic {    -o /tmp/cond01.out should_work/broken/cond01.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/cond01.ec  should_work/broken/cond01.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/ts02.out should_work/broken/ts02.lus}
 FAIL: Generate ec code  : ./lus2lic {-ec -o /tmp/ts02.ec  should_work/broken/ts02.lus}
-PASS: ./lus2lic {    -o /tmp/overload.out should_work/broken/overload.lus}
-PASS: ./lus2lic {-ec -o /tmp/overload.ec  should_work/broken/overload.lus}
 PASS: ./lus2lic {    -o /tmp/main.out should_work/broken/main.lus}
 UNRESOLVED: Time out: ./lus2lic {-ec -o /tmp/main.ec  should_work/broken/main.lus}
 FAIL: without any option: ./lus2lic {    -o /tmp/m.out should_work/broken/m.lus}
@@ -845,8 +846,8 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman
 
 		=== lus2lic Summary ===
 
-# of expected passes		712
-# of unexpected failures	82
+# of expected passes		716
+# of unexpected failures	79
 # of unexpected successes	8
 # of expected failures		26
 # of unresolved testcases	5
diff --git a/test/lus2lic.time b/test/lus2lic.time
index db843ef029963be8951829a3d0a44e769c416c58..e2f5b97f93db0c0248ac1b63cd07f74ff4378eab 100644
--- a/test/lus2lic.time
+++ b/test/lus2lic.time
@@ -1,2 +1,2 @@
-testcase ./lus2lic.tests/non-reg.exp completed in 157 seconds
+testcase ./lus2lic.tests/non-reg.exp completed in 141 seconds
 testcase ./lus2lic.tests/progression.exp completed in 7 seconds
diff --git a/test/should_work/enum0.lus b/test/should_work/enum0.lus
index 334dfe7dd6622aaeaa7259de02b004c310d77fcc..71a842d3e0ca89e5bd36be662e0c04a8094820d7 100644
--- a/test/should_work/enum0.lus
+++ b/test/should_work/enum0.lus
@@ -1,3 +1,8 @@
 type color1 = enum { blue, white, black };
 type color2 = enum { green, orange, yellow };
 
+
+node t(x: color1) returns (y: color2);
+let
+  y = if x = blue then green else if x = white then orange else yellow;
+tel
\ No newline at end of file
diff --git a/test/should_work/over3.lus b/test/should_work/over3.lus
index 7a4fe54cc8d0ffa1ed58bcafd8b16b7057f6418b..6ee7a0011ef4f13825f0952b1e652819aafa3402 100644
--- a/test/should_work/over3.lus
+++ b/test/should_work/over3.lus
@@ -5,3 +5,5 @@ node mypoly<<const n : int; type t; node f (i:t) returns (o:t)>>(x, y: t^n) retu
 let
    z = map<<+, n>>(x,y);
 tel
+
+node mygrossier=mypoly<<42, int, Lustre::iminus>>;
\ No newline at end of file
diff --git a/test/should_work/type_decl.lus b/test/should_work/type_decl.lus
index 1a78f1277d672914ab4f074b875cdac7c23dd8dc..2a67438d483646d18605a8a22dded88201f6f59b 100644
--- a/test/should_work/type_decl.lus
+++ b/test/should_work/type_decl.lus
@@ -1,3 +1,8 @@
 type alias = int;
 type pair = struct { a:int; b:int };
 type color = enum { blue, white, black };
+
+node x(i1, i2: int) returns (x: pair);
+let
+  x= pair {a=i1; b=i2};
+tel
\ No newline at end of file
diff --git a/test/site.exp b/test/site.exp
index f1002e2d9201ef681cf4378a8df1ca340ac7d34c..c83c9af88046472e20065b267d3183b23a42f478 100644
--- a/test/site.exp
+++ b/test/site.exp
@@ -37,9 +37,12 @@ proc should_work { test_name command_line args } {
             set failed 1
             exp_continue
         }
+        "undeclared ident" {
+            set failed 1
+            exp_continue
+        }
         "segmentation fault" {
             set failed 1
-            fail "coucou"
             exp_continue
         }
         # to avoid that match_max (the expect buffer size) is reached