[cfe-commits] [PATCH][PR11329] StaticAnalyzer: Warn when statement body is a semicolon -- an unintended null statement

David Blaikie dblaikie at gmail.com
Tue Jan 3 13:10:55 PST 2012


Might be the target for the mythical style checker. - somewhere between
the static analyzer and the compiler
From: Dmitri Gribenko
Sent: 1/3/2012 11:08 AM
To: Anna Zaks
Cc: cfe-commits at cs.uiuc.edu
Subject: Re: [cfe-commits] [PATCH][PR11329] StaticAnalyzer: Warn when
statement body is a semicolon -- an unintended null statement
On Tue, Jan 3, 2012 at 10:56 PM, Anna Zaks <ganna at apple.com> wrote:
> Though since this is a syntactic check, maybe it could be a compiler warning.

I can reimplement it as a warning if it would be accepted.  But since
it imposes some coding style rules on the programmer, I thought that
someone might not like it.

> Minor syntax issue (occurs twice):
> +  if(QuietIfBodyOnSeparateLine)
>  ->
> +  if (QuietIfBodyOnSeparateLine)

Fixed (see attachment).

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/




More information about the cfe-commits mailing list