diff --git a/src/kernel_internals/typing/cabs2cil.ml b/src/kernel_internals/typing/cabs2cil.ml
index 7a28e4670df8c333f4595f31f9522f61eb8a9809..c3ba156d600c93787ce2fa69b00a4c3c27597b36 100644
--- a/src/kernel_internals/typing/cabs2cil.ml
+++ b/src/kernel_internals/typing/cabs2cil.ml
@@ -6401,14 +6401,14 @@ and doExp local_env
                     "Function %s is a ghost symbol. \
                      It cannot be used in non-ghost context. \
                      Did you forget a /*@@ ghost ... /?" n ;
-                Kernel.debug ~level:3
+                Kernel.debug ~dkey:Kernel.dkey_typing_global
                   "Calling function %s without prototype." n ;
                 let ftype = TFun(intType, None, false,
                                  [Attr("missingproto",[])]) in
                 (* Add a prototype to the environment *)
                 let proto, _ =
                   makeGlobalVarinfo false
-                    (makeGlobalVar ~temp:false n ftype) in
+                    (makeGlobalVar ~temp:false ~loc:f.expr_loc n ftype) in
                 (* Make it EXTERN *)
                 proto.vstorage <- Extern;
                 proto.vdecl <- f.expr_loc;
diff --git a/tests/syntax/oracle/syntactic_hook.res.oracle b/tests/syntax/oracle/syntactic_hook.res.oracle
index dd40fc1cad6dabdd06074fcf0ea1e432de1a703d..ea620c5e776b8372ff6abf834f8c7a3549a48386 100644
--- a/tests/syntax/oracle/syntactic_hook.res.oracle
+++ b/tests/syntax/oracle/syntactic_hook.res.oracle
@@ -10,7 +10,7 @@
 [kernel] syntactic_hook.i:16: New global node introducing identifier t(35)
 [kernel] First occurrence of t
 [kernel] syntactic_hook.i:16: Warning: [SH]: definition of local function t
-[kernel] :0: New global node introducing identifier g(37)
+[kernel] syntactic_hook.i:20: New global node introducing identifier g(37)
 [kernel] First occurrence of g
 [kernel:typing:implicit-function-declaration] syntactic_hook.i:20: Warning: 
   Calling undeclared function g. Old style K&R code?
diff --git a/tests/syntax/syntactic_hook.i b/tests/syntax/syntactic_hook.i
index 7061a2336c6de7c1009bd0ff14f57990274a38d6..a5caf8dad3c3dad02982427e334783ac5f3b1d49 100644
--- a/tests/syntax/syntactic_hook.i
+++ b/tests/syntax/syntactic_hook.i
@@ -1,7 +1,7 @@
 /* run.config
  MODULE: @PTEST_NAME@
  EXIT: 1
-   STDOPT: +"-no-autoload-plugins"
+   STDOPT:
 */