mirror of
https://github.com/dgibson/dtc.git
synced 2026-01-22 01:30:34 -05:00
Create new and use new print_error that uses printf style formatting.
yyerror is meant to be called by the parser internal code, and it's interface is limited. Instead create and call a new error message routine that allows formatted strings to be used. yyerror uses the new routine so error formatting remains consistent. Signed-of-by: John Bonesio <bones@secretlab.ca> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
parent
8773e12fa9
commit
c0fa2e6d4e
3 changed files with 33 additions and 18 deletions
2
srcpos.h
2
srcpos.h
|
|
@ -76,6 +76,8 @@ extern struct srcpos *srcpos_copy(struct srcpos *pos);
|
|||
extern char *srcpos_string(struct srcpos *pos);
|
||||
extern void srcpos_dump(struct srcpos *pos);
|
||||
|
||||
extern void srcpos_verror(struct srcpos *pos, char const *, va_list va)
|
||||
__attribute__((format(printf, 2, 0)));
|
||||
extern void srcpos_error(struct srcpos *pos, char const *, ...)
|
||||
__attribute__((format(printf, 2, 3)));
|
||||
extern void srcpos_warn(struct srcpos *pos, char const *, ...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue