X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=nesc.git;a=blobdiff_plain;f=src%2Fnesc-task.c;fp=src%2Fnesc-task.c;h=c732a33e6a8881179520fb1227fde1440d0fa599;hp=5d36bb661a7c4b277efcf6b06e687568703836f1;hb=7b54393e237ed8f23c0c74f0a6cbc8de26c5bf98;hpb=57d4530c4d6814fa25338a00cc65b95938c723b6 diff --git a/src/nesc-task.c b/src/nesc-task.c index 5d36bb6..c732a33 100644 --- a/src/nesc-task.c +++ b/src/nesc-task.c @@ -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;