Re: makedoc.c: Warning when -Wall

Jon Turney <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
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 :)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.