| 1 | // Error messages should not contain newlines. This script finds |
| 2 | // messages that do. Fixing them is manual. |
| 3 | @r@ |
| 4 | expression errp, err, eno, cls, fmt, ap; |
| 5 | position p; |
| 6 | @@ |
| 7 | ( |
| 8 | error_vreport(fmt, ap)@p |
| 9 | | |
| 10 | warn_vreport(fmt, ap)@p |
| 11 | | |
| 12 | info_vreport(fmt, ap)@p |
| 13 | | |
| 14 | error_report(fmt, ...)@p |
| 15 | | |
| 16 | warn_report(fmt, ...)@p |
| 17 | | |
| 18 | info_report(fmt, ...)@p |
| 19 | | |
| 20 | error_report_once(fmt, ...)@p |
| 21 | | |
| 22 | warn_report_once(fmt, ...)@p |
| 23 | | |
| 24 | error_setg(errp, fmt, ...)@p |
| 25 | | |
| 26 | error_setg_errno(errp, eno, fmt, ...)@p |
| 27 | | |
| 28 | error_setg_win32(errp, eno, cls, fmt, ...)@p |
| 29 | | |
| 30 | error_propagate_prepend(errp, err, fmt, ...)@p |
| 31 | | |
| 32 | error_vprepend(errp, fmt, ap)@p |
| 33 | | |
| 34 | error_prepend(errp, fmt, ...)@p |
| 35 | | |
| 36 | error_setg_file_open(errp, eno, cls, fmt, ...)@p |
| 37 | | |
| 38 | warn_reportf_err(errp, fmt, ...)@p |
| 39 | | |
| 40 | error_reportf_err(errp, fmt, ...)@p |
| 41 | | |
| 42 | error_set(errp, cls, fmt, ...)@p |
| 43 | ) |
| 44 | @script:python@ |
| 45 | fmt << r.fmt; |
| 46 | p << r.p; |
| 47 | @@ |
| 48 | if "\\n" in str(fmt): |
| 49 | print("%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt)) |