Skip to content

Commit

Permalink
(for debugging) cpp.ansi: echo line directives as warning messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkchia committed Oct 26, 2024
1 parent da2ba5e commit a71c5a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lang/cem/cpp.ansi/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef ERROR_H_
#define ERROR_H_

#if __STDC__
#ifdef __STDC__
/*VARARGS*/
void error(char *fmt, ...);
/*VARARGS*/
Expand Down
4 changes: 3 additions & 1 deletion lang/cem/cpp.ansi/preprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ char bits[128];
#endif
extern int InputLevel;

extern char* sprint();
extern char* sprint(const char *, ...);

void Xflush(void)
{
Expand Down Expand Up @@ -142,6 +142,8 @@ static char *line_directive(unsigned int lineno)
Xbufsize = needsize;
}
sprint(Xbuf, "%s %d \"%s\"\n", LINE_PREFIX, (int)lineno, FileName);
warning("%s %d \"%s\"\n", LINE_PREFIX, (int)lineno, FileName);
warning("%s", Xbuf);
return Xbuf;
}

Expand Down

0 comments on commit a71c5a9

Please sign in to comment.