#include <string.h>
#include <ctype.h>
-static const char explain[]
-= "Headers usually start with the C preprocessor lines to prevent multiple\n"
- "inclusions. These look like the following:\n"
- "#ifndef CCAN_<MODNAME>_H\n"
- "#define CCAN_<MODNAME>_H\n"
- "...\n"
- "#endif /* CCAN_<MODNAME>_H */\n";
-
static void fix_name(char *name)
{
unsigned int i;
if (!f->lines[i])
return;
- /* We expect a condition on this line. */
+ /* We expect a condition around this line. */
if (!line_info[i].cond) {
- score_file_error(score, f, i+1, "Expected #ifndef");
+ score_file_error(score, f, first_preproc_line+1,
+ "Expected #ifndef");
return;
}
/* We expect the condition to be ! IFDEF <symbol>. */
if (line_info[i].cond->type != PP_COND_IFDEF
|| !line_info[i].cond->inverse) {
- score_file_error(score, f, i+1, "Expected #ifndef");
+ score_file_error(score, f, first_preproc_line+1,
+ "Expected #ifndef");
return;
}
return;
}
+ /* Record this for use in depends_accurate */
+ f->idempotent_cond = line_info[i].cond;
+
/* Rest of code should all be covered by that conditional. */
for (i++; f->lines[i]; i++) {
unsigned int val = 0;
}
static void check_idempotent(struct manifest *m,
- unsigned int *timeleft, struct score *score)
+ unsigned int *timeleft UNNEEDED,
+ struct score *score)
{
struct ccan_file *f;