makedoc.c: Warning when -Wall

Jon Turney jon.turney@dronecode.org.uk
Sat Jun 19 16:54:26 GMT 2021


On 17/06/2021 22:52, Joel Sherrill wrote:
> Hi
> 
> I noticed in tbe build output that makedoc.c is compiled without -Wall. I'm
> not sure how to add that to the Makefile but when I built it by hand, it
> turned up this single warning. I am not sure where the parentheses should
> go to address the warning and ensure this is doing what's intended. It
> doesn't help that I don't know what the intent is. :).
> 
> ../newlib-cygwin/newlib/doc/makedoc.c: In function ‘courierize’:
> ../newlib-cygwin/newlib/doc/makedoc.c:574:6: warning: suggest parentheses
> around ‘&&’ within ‘||’ [-Wparentheses]
>        && (at(tos, idx+1) == '.')
>        ^
> Thanks.

I think the intent is:

	    && (at(tos, idx +1 ) == '.'
		|| at(tos,idx+1) == '|'))

... which is done with correct parenthesization about 30 lines above :)


More information about the Newlib mailing list