Simon Josefsson wrote:

> I got this from 'make syntax-check' in a project:
>
> oathtool/oathtool.c-225- printf ("Step size (seconds): %ld\n",
> time_step_size);
> oathtool/oathtool.c-235-        printf ("Time now: %s (%ld)\n", outstr, when);
> maint.mk: found capitalized error message
> make: *** [sc_error_message_uppercase] Fel 1
>
> Is the regexp wrong here?  It looks fine to me, maint.mk:
>
> # Error messages should not start with a capital letter
> sc_error_message_uppercase:
>       @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))              \
>           | grep -E '"[A-Z]'                                          \
>           | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' &&           \
>         { echo '$(ME): found capitalized error message' 1>&2;         \
>           exit 1; } || :

Hi Simon,

That rule uses the heuristic of searching two lines after each
use of error(..., in case message arguments are on continued lines.
As such, it is subject to false positives, as you've found.
If you look at the lines just before the one it matched,
you should find a use of error (...

You might just want to disable that warning altogether, or exempt
the containing file.

Reply via email to