]> oss.titaniummirror.com Git - nesc.git/blobdiff - src/nesc-task.c
Merge branch 'upstream' (nesc-1.3.2)
[nesc.git] / src / nesc-task.c
index 5d36bb661a7c4b277efcf6b06e687568703836f1..c732a33e6a8881179520fb1227fde1440d0fa599 100644 (file)
@@ -340,7 +340,27 @@ void wire_scheduler(module m)
   struct endp m_end, scheduler_end;
 
   if (!scheduler_interface)
-    return;
+    {
+      declaration task;
+      static int use_module = 0;
+
+      /* If all_tasks is non-null, we have a problem: a task that needs to
+        be wired, but the scheduler is not yet available. Report as an error.
+      */
+      scan_declaration (task, all_tasks)
+       {
+         error_with_location(task->location, "scheduler depends on a task");
+         if (!use_module)
+           {
+             use_module = 1;
+             error_with_location(task->location,
+                                 "The -fnesc_scheduler flag should specify a module");
+             error_with_location(task->location,
+                                 "(the module with the scheduling code, even if the scheduler is a configuration)");
+           }
+       }
+      return;
+    }
 
   m_end.component = NULL;
   m_end.function = NULL;